Re: How long where issues open?

Ralf Schlatterbeck <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
On Mon, Dec 07, 2015 at 10:13:02AM +0100, Bernhard Reiter wrote:
> Hi Rounduppers,
> 
> let us say I want to know how 
> long a support ticket is open on the average. 
> 
> More general this would be how long is an issue in state A(a,b)
> before it moved to state B(c,d,e).
> I could of course compute this by writing a python script that
> asks the history of an issue and computes 
>  last time the issue was in A
>  last time the issue was B
>  substract
> 
> I am thinking about a more clever way of doing this.
> About a reactor that will do the calculation each time
> an issue moves to B and put it into a a field?
> Once and issue moves back to A, the field could be deleted again.
> Now my stats can just be based on this was-open-field.
> 
> Did somebody model this with roundup?
> If so, how did you do it?
> If not, how would you model it?

I usually have an additional field in issued called "closed" that models
the closing date. And then an auditor that sets this field when the
issue goes to some state that is considered "closed" (depending on your
status values there may be more that one state that denotes end-of-life
of an issue). Note that the code gets easier if you don't compute the
names of the stati -- in my code I'm using the states for other stuff,
too.

def closed_auditor (db, cl, nodeid, newvalues)

    new_status_name = cur_status_name = None
    nstat = newvalues.get ('status')
    cstat = None
    if nodeid :
        cstat = cl.get (nodeid, 'status')
    if nstat :
        new_status_name = db.status.get (nstat, 'name')
    if cstat :
        cur_status_name = db.status.get (cstat, 'name')

    # Depending on your logic here you may want to set a default status
    # for a new issue.

    # Set `closed_date` when a bug report is being closed
    # and reset it if re-opened
    if new_status_name == "closed" and cur_status_name != "closed" :
        newvalues ["closed"] = Date (".")
    if new_status_name != "closed" and cur_status_name == "closed" :
        newvalues ["closed"] = None

Among other things I've using this for a plot of open issues by day for
certain projects. Similar to Debian's open issues per release.
Other statistics like your use-case are of course also possible.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   http://www.runtux.com
Reichergasse 131, A-3411 Weidling       email: [email protected]

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.