Hi Experts,
I have created a text custom field and want that to auto incrment automatically after every jira story is created.
For e.g if the first jira story has fieldvalue as PD1, the next jira story automatically gets PD2
I am using Jira cloud
Welcome to the community!
You can create increment and store a sequence number via Jira automation.
At a high level, you want to store a value with the key "sequence" (or whatever you want to call it) in the properties of the project. With each creation of a ticket, you can increment that value and store it again the issue.
This is what your automation should look like:
{{#increment}}{{project.properties.sequence}}{{/}}
The above is an automation math expression which increments the number in between the start "{{#increment}} and the closing tag {{/}} of the expression.
{{issue.project.properties.sequence}}
Cheers,
Jens
Hi @Jens Schumacher - Released_so , Thank you for your reply.
I did as you said and the rule is getitng triggered with no error. However still the field which had to autopopulate was blank. I am not sure what i am doing wrong here.
I had set project property as {{#CRM12}}{{project.properties.ProductCode}}{{/}}
and in the edit issue i had below
Not sure where i am doing wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dheeraj Singh
It looks like you have replaced
{{#increment}}
with
{{#CRM12}
Not sure what the intention was, but {{#increment}} is critical here as this is the function that will increment the value within the function call.
Basically, try replacing #CRM12 with #increment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again @Jens Schumacher - Released_so . I have replaced that and now i am getting below error
New config after replacing #CRM12 to #increment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try pasting the string into the "ProductCode" textfield, not "Additional fields"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Jens Schumacher - Released_so for patiently answering my queries. I can confirm that the error has been resolved.
Just a last question- Where do i pass the value of the field "productcode". For e.g if i want that to start with PD1 and then increment to PD2 next time. Where do i actually store this value so that it increment automatically with this value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please refer back to the first answer. What we are doing here is:
The second part happens in the "Edit issue fields" step. If you want to add the prefix, all you need to do is to output the number we stored with the prefix in front of it.
PD{{issue.project.properties.ProjectCode}}
Feel free to mark the comment as Answered if this resolved your question. Thanks!
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.
This worked perfectly! If I wanted to start the "sequence" variable at a given number, is there a way to do that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is great, thanks for sharing!
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.