Hi,
I have created a automation rule to get Number sequence once issue type is created in jira but seems the sequence number is not getting updated automatically.
Rule steps
1.Issue created
2.Issue type = Risk
3.{{lookupIssues.Sequence Number.max.plus(1)}}
Let me know if I have missed something or need to change the smart value.
REgards,
Suma
Hello and Welcome @Kustagi Suma
You’re super close, but two key pieces are missing.
Right now you’re using {{lookupIssues…}}, but that only works if you actually add a Lookup issues action first. And even after you calculate the value, Jira won’t update anything unless you write it into the field with an Edit issue action.
A working flow is:
Trigger: Issue created
Condition: Issue type = Risk
Action: Lookup issues (JQL like: project = XYZ AND issuetype = Risk AND "Sequence Number" is not EMPTY)
Action: Edit issue → set Sequence Number to:
{{lookupIssues."Sequence Number".max.plus(1)}}
Also add a fallback for the very first Risk:
If {{lookupIssues.size}} = 0 → set Sequence Number = 1
Else → max + 1
One more heads-up: this “max+1” approach can create duplicates if two Risk issues are created at the same time. If you need guaranteed unique numbering, you’ll need a real counter (Assets/external/etc.).
This could be done with a rule like:
{{#increment}}{{issue.project.properties.count}}{{/}}
{{issue.project.properties.count}}
That would set the value uniquely for every issue created in that project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.