Hi,
I am trying to setup an automation that will increment a number custom field by 1 each time it cycles through the relevant stages.
The problem I am encountering is that however it set these rules up, the field will only increment from empty to 1, when it cycles through the stages again, the field will not increment from 1 to 2 and so on.
I have tried variations of math operators in the edit issue action, all result in the same, the current format I am using is below
{{#increment}}{{issue.customfield.customfieldID}}{{/}}
When checking the automation audit logs, it states all conditions were met, and the action was successful. Yet the field remains at 1.
I am sure I am missing something, but I see this has been an issue for others in the community, but from reading the forums could not see a clear answer.
From testing it seems the above just sets the field to 1 as opposed to incrementing. If I manually set the field to empty, 0 or 2 for example, cycling through the stages updates the field to 1 every time.
Thank you in advance.
The increment variable is mentioned here:
It seems it should work. But your value is wrong:
{{#increment}}{{issue.customfield.customfieldID}}{{/}}
This is from the post:
{{#increment}}{{issue.yourcustomfield}}{{/}}
should be issue.customfield_1000 for example. remove the first customfield and add your custom field ID.
Regards
Hi Aaron,
Thank you for the advice, I have adjusted format of the increment as you described, replacing the ".customfieldID}}" for "_customfieldID}}" and this is now incrementing correctly.
Many Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Nathan Price ,
Welcome to the community!
Reading up on what you already tried, this should work with a small modification.
Some other versions that should work would be:
As an action: Edit "Field x" with smart value:
{{#increment}}{{issue.Field x}}{{/}}
{{#=}}{{issue.Field x}} + 1{{/}}
{{issue.Field x.plus(1)}}
Those should all work under 1 condition -> Field x has to be a number field. If it is not, you are trying to calculate with strings instead of numbers, that does not work.
You have to help the system recognize that it is a number, you could do that like this:
{{#=}}{{issue.Field x.asNumber}} + 1{{/}}
{{issue.Field x.asNumber.plus(1)}}
Did any of that solve your issue?
- Tessa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.