1

1

Our organization has a need to begin producing SLA (http://en.wikipedia.org/wiki/Service_level_agreement) reports for some clients.

The logical starting point for us is 'time to initial response', where the response is a human response, not the FogBugz auto-generated response.

flag

1 Answer

0

Here's the Python script I came up with to go through all cases in the Inbox project for the last 30 days and spit out, for the ones that'd gotten a reply, the time difference between the case open and the first reply.

#!/usr/local/bin/python

import re, string, sys
from fogbugz import FogBugz
from datetime import datetime,timedelta


fogbugz = FogBugz('http://foo.fogbugz.com', "")
api_date = '%Y-%m-%dT%H:%M:%SZ'


min_case = 1
ixbug = 0
while True:
    resp = fogbugz.search(q='project:inbox area:support opened:"-30d.." orderby:case case:"%d.."' % (ixbug + 1),cols='ixBug,dtOpened,events',max=100)

    case_found = False
    for case in resp.findAll('case'):
        case_found = True
        ixbug = int(case['ixbug'])
        for event in case.findAll('event'):
            if event.sverb.string == 'Replied':
                td = datetime.strptime(event.dt.string,api_date) -  datetime.strptime(case.dtopened.string,api_date)
                print ",".join(["%s" % ixbug,case.dtopened.string,event.dt.string,'%d' % (td.seconds + td.days * 24 * 3600)])
                break
    if case_found == False:
        break
link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.