how many times in each transition

virginia caruso June 23, 2014

hello, I need to count, how many times the workflow is in one status. Example:

teh workflow is: Status: A, B, C. from A go to B, from B to C o to A. So I need to know how many times the workflow goes from B to A.

thanks!

2 answers

0 votes
Marcus Silveira
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 23, 2014

Hi Virginia,

If you'd like to go the DB approach, you may want to take a look at the changeitem, changegroup and jiraissue tables.

This should get you a list of the issues that have moved from status B to A in JIRA 6 and newer

select P.pkey,I.issuenum from jiraissue I
join project P on I.project=P.id
join changegroup CG on CG.issueid=I.id
join changeitem CI on CI.groupid=CG.id
where CI.field = 'status'
and CI.oldstring = 'B'
and CI.newstring = 'A'

Older versions should be like this

select I.pkey from jiraissue I
join changegroup CG on CG.issueid=I.id
join changeitem CI on CI.groupid=CG.id
where CI.field = 'status'
and CI.oldstring = 'B'
and CI.newstring = 'A'

Hope this helps

Tristan Leask September 25, 2014

Silly question... this is the sort of thing I need to do. How do I go about running this query against our own Jira system? We don't use ondemand, we have our own server.

0 votes
Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2014

You will have to do some custom development to report on this. Data is there in the DB and it is only a matter of extracting it and showing it to the user which is where the various plugin modules can help. A report or gadget might be enough but it depends on your requirement.

Another option is to increment a custom field value in the workflow post function but if you want to track all workflow changes, there are just too many combinations and will need lot of custom fields.

virginia caruso June 24, 2014

hi Jobin, thanks for your response.

Do you know any plugin to help me?

In yhe another option, how can I increment a custom field? Can I use a function?

thanks again.

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2019

@Jobin Kuruvilla [Adaptavist] about your second suggestion, could you provide more detail about how to handle this using a custom field. As far as I know the available post-function to modify a field, does not apply for custom field. So I don't see how to update automatically this custom field. Thanks

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

JMWE plugin has a function to do it.  You can also do it one of the scripting plugins.

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

JMWE plugin has a function to do it.  You can also do it one of the scripting plugins.

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

@Jobin Kuruvilla [Adaptavist] Thank you!. Do you know about any solution without purchasing a plugin, We already paid for having Jira and this is a basic functionality that should be out of the box. 

Jobin Kuruvilla [Adaptavist]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

Unfortunately, I am not aware of any other way to do it, other than writing a custom add-on!

David Leal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 18, 2019

@Jobin Kuruvilla [Adaptavist]Thanks anyway, do you have some idea about how to write a custom add-on for this?

Suggest an answer

Log in or Sign up to answer