Auto Increment counter and assign issue field value when a new Jira work item is created
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
This documentation explains how we can use Jira Automation to maintain a counter in the Project and Automatically Increment it when a new work item is created and assign this count as the Issue Field Value.
We are going to use the Project Entity Property. Also, we are going to set the initial project counter as 10000 (This can be changed as per requirement).
Solution
Create a new Rule with 'Issue Created' as the Trigger.
Add an If-Else Condition Block.
Under the If section:
add an Advanced Comparision Condition. Use the smart variable {{project.properties.sequence}} to check if the current value is less than 10000.
Then: if {{project.properties.sequence}} is less than 10000, Set the 'Project' Entity property 'sequence' to 10000.
In the Else section, (then:)increment the 'Project' Entity property 'sequence' using the smart variable
{{#increment}}{{project.properties.sequence}}{{/}}
Use the Edit Issue Action and set the Issue custom Field current_count value using the smart value {{project.properties.sequence}} of the 'Project' Entity property 'sequence'.

Was this helpful?