Is it possible to count the number of times issue made specific transaction?

Akshay Laykar October 26, 2018

I want to get number of times the issue made some transaction. 

Suppose my workflow has Ready to Retest--> Reopen. Now if 1 issues is marked as ready to retest but it was reopened, again after fixing that issue was marked ready to retest but again tester reopens the issue. 

 

Considering above scenario I want to know how many times the issue was reopened.(need its count) 

 

Thanks in Advance.

4 answers

1 vote
Veronica Mapes July 30, 2020

Found another simple way to do this: 

Set up a rule on your project to listen for a specific issue transition (either using JQL condition or the transition options, then add an Edit issue action.

Select the field you want (My Customfield) to increment and use the following value:

{{#increment}}{{issue.My Customfield}}{{/}}

This will increase the value every time the issue goes into that status.

 

Found this from @Nick Menere

https://community.atlassian.com/t5/Marketplace-Apps-Integrations/How-may-I-increment-a-custom-field-s-number-on-a-specific/qaq-p/742636

Christine Corona June 7, 2021

Hi @Veronica Mapes , I was trying to implement your solution and I continue to get this error: Error while parsing additional fields. Not valid JSON.

Would you mind looking at my screenshot and tell me where I'm going wrong? I know it's user error I just don't know what I'm failing to do. 

Thank you, 

ChristineJSONerror.png

Like u610373 likes this
Veronica Mapes June 7, 2021

@Christine Corona - It looks like you have spaces between the brackets, though I can't be sure. If so, try removing those. If not, I'm not sure =/

{{#increment}}{{issue.My Customfield}}{{/}}
Christine Corona June 8, 2021

Thanks @Veronica Mapes, I indeed had spaces so I removed those. I also needed to remove the value from the Additional fields section and place it only under the identified custom field section, then it worked perfectly!

Hi Veronica and Christine,

 

I'm also finding this way to count my transition and it is working. Thanks a lot!.

So I just want to share an image of what does Christine said about remove value from the additional field section and place it under identified custom field section. Bcos previously I could not understand it. Probably this can help others too. <3Capture2.PNG 

Like # people like this
0 votes
Radhika Vijji _Innovalog_
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.
May 25, 2020

Hi Akshay,

Do you have Jira Misc Workflow Extensions plugin in your Cloud instance? If yes,

  1. Create a custom type number field "Reopened count"
  2. Add the Increase value of field post-function to the "Reopen" transition (https://innovalog.atlassian.net/wiki/x/PICcBQ) 
  3. Select the "Reopened Count" field
  4. Save the post-function
  5. Publish the workflow.

Now every time the ticket is reopened the "Reopened Count" field value increments by 1.

Hope this helps,

Regards,

Radhika

0 votes
Burak Kocak October 26, 2018

Hi @Akshay Laykar

I found a free plug in https://marketplace.atlassian.com/apps/27136/jira-misc-custom-fields?hosting=server&tab=overview

that has the functionalty of your needs.  You can check that one. As Elifcan mentioned above, its  not easly possible to find transtion count without searching history tab.

 

Formula-based Calculated Custom Fields

 

Transition date/time and transition caller

 

JQL functions

Create calculated custom fields that evaluate a Java expression to compute the value of the field. Can be of type Number, Date or String.

Create custom fields that will hold the date/time or the name of the caller of any transition in your workflow.

Additional JQL functions you can use in your issue filters.

More details

The Jira Misc Custom Fields plugin's objective is to provide several new types of custom fields for use in custom Jira workflows as well as useful JQL functions.

Included custom fields:

Included JQL function:

  • currentUserPropertyAsList: a JQL function that returns the value of a property of the current user, transforming comma-separated values into a list of values.
Akshay Laykar October 28, 2018

@Burak Kocak Thank you for your suggestion too.. but may be Jira Misc Custom Fields plugin is available for server and we are using cloud version. 

Sergio Renzo May 25, 2020

hey Burak ... I know it's a lot time ago, but JMCF plugin is not free anymore ... do you have other suggestion to do the same for FREE ? thx !!!

0 votes
Elifcan Cakmak
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.
October 26, 2018

Hello,

I don't think it's possible without any add-ons. For example with Script Runner plugin you can define a scenario like this:

  • Create a number custom field
  • Write a script that increases the field value each time the issue transitioned.
  • Add the script as a post function to your transition.

It is the best possible solution that I can think of on Cloud. 

Regards,

Elifcan

Akshay Laykar October 28, 2018

@Elifcan Cakmak Thank you for the valuable suggestion. But can I get the count of transactions which are already made.  

Elifcan Cakmak
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.
October 29, 2018

Hey, 

I'm afraid there is no automatic way to get that number. You can check issues one by one, you can see the transitions made on the transition tab but I'm sure you already know that and it is not an ideal solution. I'm sorry I couldn't be more help.

Regards,

Elifcan

Filip Tanevski February 21, 2020

Hi @Elifcan Cakmak ,

Regarding your solution with ScriptRunner:
 I am new to JIRA and ScriptRunner - do you have an example of how can that script look like?

Suggest an answer

Log in or Sign up to answer