Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically Increment Custom Field on Transition

Zeynel Abidin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2020

Hi,

we need an auto-increment custom field.
Automatically calculated in transitions (Create)

Each issue should have unique custom field value. 

Example format : ITPRJYEAR-001
In the 2020
ITPRJ2020-001
ITPRJ2020-002
.....
In the 2021
ITPRJ2021-001
ITPRJ2021-002

"ITPRJ": Fixed
YEAR: Years of the current that time (when Issue created)
001: First number each year must be auto incremental

If the issue deleted, it doesn't matter unless the queue is broken

How can i solve this problem using JIRA Workflow Toolbox (Decadis) or Scriptrunner

1 answer

1 accepted

1 vote
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 24, 2020

Hello @Zeynel Abidin ,

Jira natively does not have any built in incrementing field types so to get this information you will want to look into an add-on that can do this.  I have listed a few below that can do this I would recomend checking them out to see which ones meet your needs the bes or possibly have additional functions that you are looking for and could be used to meed multiple requirements for your setup.

One options to look at would be to use "Jira Misc Workflow Extensions (JMWE)" and create a custom field of type Number, and add in a "Increase Value of field Post Function" to  increase the field value each time you go through the desired transition. 

Or you could also look at "JSU Automation Suite for Jira Workflows" , that has a similar "Update any Issue Field Post-Function" that could be leveraged.

There is also "Jira Misc Custom Fields (JMCF)" from the same vendor as JMWE mentioned above that has a "Transition Count Field" custom field type, that would provide similar behavior but be nested in a field designed specifically for this action.

Another option would be to look at "ScriptRunner for Jira" , and I found an example script posted in the following thread for an idea on how to set it up using this tool:

Additionally if you are looking for reporting options on transitions there are Add-ons like  Time in Status that will give detailed reports on various status and transition operatons as well that could also apply to your use case.

Regards,
Earl

Hugh Macfarlane August 4, 2022

JMWE took 2 minutes to add, 5 minutes to get my head around, and 5 minutes to add the post function in 4 places. Free because we have <10 users. Amazing. Thank you Earl

Suggest an answer

Log in or Sign up to answer