I have a custom field (number) and on transition post function I want to increment the value by 1

Craig Bucklow January 21, 2019

On Jira Cloud I have a custom field (number) and would like to increment the value between a certain transition in the workflow. How can I do this? Do I just need to create a transition post function on a custom field? 

3 answers

2 votes
Stuart November 14, 2019

Hi, if you want an old school way of doing this without an add-on or a script I did this:

I created a custom text field then added a post function to status change to add a field value  with an 'I' and selected Append Value so every time it passes this state it add another 'I', this resulted in a field displaying 'IIIIIII'

I then used this in a report by exporting into Excel and using the =LEN(cell) to count the number of 'I's in the field.  

Tanya B. April 30, 2020

Very nice, I've used this same concept for AtTask/WorkFront.  It works nicely.

1 vote
Alexey Matveev
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 21, 2019

Hello,

You would need an add-on for it. 

For example, you could use the Power Scripts add-on:

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

You could write a post function with a code like this:

#{Your custom field name} = #{Your custom field name} + 1;
1 vote
Taranjeet Singh
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 21, 2019

@Craig Bucklow You need to use a 3rd party add-on like ScriptRunner for JIRA. You can use a Scripted Post-function (from this add-on) on your workflow transition and use the code here (Modify it as per your custom field)

https://community.atlassian.com/t5/Jira-questions/How-can-I-increment-a-custom-field-value-in-a-post-function/qaq-p/74690

Suggest an answer

Log in or Sign up to answer