Forums

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

To have a incremental field that is automatically populated on creation, with the value "REQ.(N+1) w

Abhi August 6, 2023

Can anyone suggest me an automation rule , to make the below condition 

To have a incremental field that is automatically populated on creation, with the value "REQ.(N+1) where N(Incremental) is the value from the most recently created story., and whenever a issue type = story is deleted, Then it has to continue the Next Incremental value , when a new story issue is created.

Regards,

Abhi

2 answers

0 votes
Bill Sheboy
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.
August 7, 2023

Hi @Abhi 

To do what you ask, increment the value from the "most recently created story", you must first find the most recently created story.

You appear to be using Jira Server / Data Center version of automation.  The action Lookup Issues would make this easier, but that is still in progress of being released: https://jira.atlassian.com/browse/JIRAAUTOSERVER-53

A work-around is to call the REST API to get the most recently created story, using JQL to ORDER BY Created DESC, and then use the first record's field value for the increment.

Kind regards,
Bill

0 votes
Sayed Bares _ServiceRocket_
Community Champion
August 7, 2023

@Abhi I would suggest creating two automation, one for incrementing (+1) REQ when story is added and another one for decrementing (-1) when a story is removed. 

For both of your automation listen to issue creation trigger and then check within an If/else block if it is a story issue type. Upon confirming Edit issue and increment/decrement your field's value.

To Increment use the following smart value:

  • {{#=}}{{issue.field name}} + 1{{/}}

     

To Decrement use the following smart value:

  • {{#=}}{{issue.field name}} - 1{{/}}
Abhi August 7, 2023

Hello @Sayed Bares _ServiceRocket_ 

Thanks for your reply.

Sorry to this say, this is not working, infact the value of number field example(Incremental ID) , is not getting increased with every story created, the value of the field always results in 1.

I have attached the automation rule.

Automation.PNGRegards,

Abhi

Suggest an answer

Log in or Sign up to answer