I need to auto increment the field " Numbers" which is a text field.

Priyanka khare January 11, 2021

I need to auto increment the field " Numbers" which is a text field and I am using "Automation for JIRA" for the same. Please find the attached rule which is not working because I am missing something in the rule. Can anyone please look into this .

My requirement is that when ever any new issue is created in my project the "Numbers" field should be auto inc3.PNGincremented instead of doing it manually. Since I am not very good with scripting I am trying to use "automation for JIRA"

2 answers

1 vote
Gareth Cantrell
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 11, 2021

Hi @Priyanka khare 

You can achieve that by using the smart function "asNumber()" to convert the text field to a number, however you need to be sure that only numeric values will be present in the field.

You can do this as follows:

{{#increment}}{{issue.Numbers.asNumber}}{{/}}  

 

0 votes
Nic Brough -Adaptavist-
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 11, 2021

The increment function cannot read strings and guess that they might be numbers.  You'll need to code something that converts to a number, adds something to it, then converts it back to a string.  I do not believe automation can do that.

You'll need something like Scriptrunner, or change to using a numeric field (then the increment function in Automation will work)

Jack Brickey
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 11, 2021

+1 for converting to numeric field

Suggest an answer

Log in or Sign up to answer