Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How may I increment a custom field's number on a specific transition?

Each time the transition "blah" is used I want to increment a custom field by 1. If the field's value is empty, it should become 1. If the field's value is 3 it should become 4.

The transition "blah" transitions issues to a status used by all issues, so basing the rule off the status is not possible. Each time the transition "blah" is used the issue has the resolution set to "blah" and then cleared using post-functions. This is a poor effort at keeping track of when the transition "blah" was used. The "blah" transition only exists once in-between two status' on my workflow.

The only add-on I have installed on my cloud instance of Jira is Automation for Jira and I'd like to keep it that way. Thanks in advance for your help.

2 answers

1 accepted

3 votes
Answer accepted

Hi Ryan,


You can definitely do this. To do this set up a rule to listen for an issue transition, add a Jql condition to check status of the issue (status = blah) and 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.


Let us know if you have any specific problems with it or if I mis-understood the use-case.




This worked flawlessly, Nick! You're a gentleman and a scholar. Thank you.

Glad to have helped!

Hi there!

Tried to replicate on a number field, but got some problems:


Whenever I try to paste some part of the script it gives me an "invalid number" error.

Since it's my first time scripting in automation, I did some trouble shooting and it gives me the same error even with 

{{issue.My Customfield}}



I'm quite puzzled because I don't have any actual idea about what is going on :(


Hi Tiziano,

Are you able to provide a screenshot of your rule and esp. the configuration for this field.




Hi Nick,

I am embarassed to say that after a good head scratching I have come to the solution and I am sorry to have bothered the community: Automation for Jira it's not the same as Jira's Automation :)

I filed a request to our purchasing to get the plugin asap.

Thank you for your quick response,

Like Jenifer Kuntz likes this

I am unable to get this to work.  I copied the script changed it to my field and I get, "Unable to update custom field"

Hey Jared,

Can you share a screenshot of your rule config and the resulting Audit Log.




Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

How to create a Confluence page linked to a Jira cloud ticket

Have you been looking for a solution to easily create Confluence pages directly from a Jira Cloud issue? The no code solution is here with the brand new app Elements Publish to Confluence, which work...

41 views 0 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you