Hello :)
I'm trying to automatically increment a counter when a card issue passes through a specific transition.
After my QA team testing procedure, the issue can pass through "test rejected" transition and i would like to count every time it happens for the same issue (Counting rework).I think about a custom field counting it.
Does anyone have some suggestion dealing with this without plugins (or using only automation for JIRA)? Maybe a different approach?
Hello @lucas_almeida
Thank you for reaching out.
Per your description, I understand you would like to increment a custom field by 1 every time you transition your issue to a specific status. Is that correct?
You can definitely create a custom number field and use an automation rule to properly increment the field when a specific transition occurs. These would be the steps:
For more details about the instruction provided and how to handle numerical values with Jira automation, check the documentation below:
Use smart values to insert numerical values
Let us know if this information helps.
hi. i've been set the smart value.
on the first time, the field successfully updated (from 0 to 1). but for the second time so on, it failed to increment the value (value still 1).
can you help me ?
here the audit log
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Were you able to solve this? I'm having the exact same issue, works only the first time
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Humn!!! I'm also having same issue... Help appreciated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If it helps, I created a new custom field with a different name and it worked fine... I couldn't figure out why it didn't work for the old one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had a typo in the field name in issue.yourcustomfield. After correcting, it started to increase the number nicely.
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.
Can you share a snip of the automation rule details to help us try and troubleshoot?
Obviously maybe grey out or hide anything that might be sensitive!
Thanks
Lewis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey guys,
To increment a custom field. This is what I did and it seems to be working properly.
In the example below, I'm incrementing the rejection count by 1 each time the ticket is rejected. Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You don't need to re-fetch or use advanced editing, you just need to use the math calculation smart value which is {{#=}}{{/}} then in between stick your calculation using the field smart value with the calculation you want to do, in this case, +1.
{{#=}}{{Initial Size}}+1{{/}} but the {{#=}} is more for advanced math instead of a simple increment.
It also works with
{{#increment}}{{Initial Size}}{{/}}
It also supports using a different number {{#increment}}{{Initial Size}}+2{{/}}
Here's an extreme example
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up using the Advanced field editing to get this to work:
{
"update": {
"customfield_10039": [{
"set": {{#increment}}{{issue.customfield_10039}}{{/}}
}]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sunny
Can you please help in advanced field setting, mine requirement
We have field called ID, which should automatically update with number we create issue in specific issue type.
For example if we create bug issue type ID field should update with 1 and if we create again it should come as 2, it should be unique each time issue type bug is created. Can we acheive this.
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone else that has the issue of only incrementing to 1 and not beyond.
I'd originally gone with the name of the field in the automation e.g. DaysInCurrentStatus for the field "Days In Current Status". Switching this to use the customfieldID resolved the problem.
E.G:
{{#increment}}{{issue.customfield_11566}}{{/}}
Issue details are viewable via a link like below:
https://[YOURINSTANCEDETAILS].atlassian.net/rest/api/2/issue/[YOURISSUEKEY]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm unable to get my field to increment even to 1. Call me stupid, but can you give an example of what exactly you put in [YOURINSTANCEDETAILS] and [YOURISSUEKEY]?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool this actually worked. Small change I did was use this link -> https://[YOURINSTANCE].jira.com/rest/api/2/field to get my custom ID
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies I did write a response to this but my browser clearly decided no!
Your instance details will be visible in the URL when you are on any Jira page. If you worked at ACME for example it would be:
Issue key is just the Jira number reference for one of your issues that you want to view the underlying details (such as the custom field ID for your custom field you want to increment. So if you have a project for "Road Runner Traps" you might see an issue id:
RRT-50
Hopefully that all makes sense and gives you a couple of more tools to aid in automating processes in Jira.
Thanks
Lewis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, Lewis. That is very helpful!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, I just finalized troubleshooting this with a support agent.
It actually will not work as stated for me with {{ #increment }}{{ issue.customfield_10063 }}{{ / }}
My result with this was that my numeric field was set to 1 after 1st trigger but then it was stuck there - not updated on subsequent triggers.
I had to set with a +1 increment for it to work on subsequent triggers and for my value to increment to 2,3,4 etc.
{{ #increment }}{{ issue.customfield_10063 }}+1{{ / }}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I ended up using the Advanced field editing to get this to work:
{
"update": {
"customfield_10039": [{
"set": {{#increment}}{{issue.customfield_10039}}{{/}}
}]
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For those who hit a problem, I solved it by re-fetching the issue data. Believe the rule repeatedly adds to the original value thus does not adds the second time. Hopes this helps someone.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This. Because transition in issue doesn't refresh the whole page, you won't see it increment before your very eyes without a refresh. I also noticed a very short delay, maybe 30s at most.
The top solution with {{#increment}}{{issue.myCustomFieldName}}{{/}} is working consistently for me.
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.