Each time the transition "blah" is used I want to increment a custom field by 1. If the field's value is empty, it should become 1. If the field's value is 3 it should become 4.
The transition "blah" transitions issues to a status used by all issues, so basing the rule off the status is not possible. Each time the transition "blah" is used the issue has the resolution set to "blah" and then cleared using post-functions. This is a poor effort at keeping track of when the transition "blah" was used. The "blah" transition only exists once in-between two status' on my workflow.
The only add-on I have installed on my cloud instance of Jira is Automation for Jira and I'd like to keep it that way. Thanks in advance for your help.
Hi Ryan,
You can definitely do this. To do this set up a rule to listen for an issue transition, add a Jql condition to check status of the issue (status = blah) and then add an Edit issue action.
Select the field you want (My Customfield) to increment and use the following value:
{{#increment}}{{issue.My Customfield}}{{/}}
This will increase the value every time the issue goes into that status.
Let us know if you have any specific problems with it or if I mis-understood the use-case.
Cheers,
Nick
This worked flawlessly, Nick! You're a gentleman and a scholar. Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to have helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there!
Tried to replicate on a number field, but got some problems:
Whenever I try to paste some part of the script it gives me an "invalid number" error.
Since it's my first time scripting in automation, I did some trouble shooting and it gives me the same error even with
{{issue.My Customfield}}
or
{{#increment}}4{{/}}
I'm quite puzzled because I don't have any actual idea about what is going on :(
Tiziano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tiziano,
Are you able to provide a screenshot of your rule and esp. the configuration for this field.
Cheers,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nick,
I am embarassed to say that after a good head scratching I have come to the solution and I am sorry to have bothered the community: Automation for Jira it's not the same as Jira's Automation :)
I filed a request to our purchasing to get the plugin asap.
Thank you for your quick response,
Tiziano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am unable to get this to work. I copied the script changed it to my field and I get, "Unable to update custom field"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Jared,
Can you share a screenshot of your rule config and the resulting Audit Log.
Cheers,
Nick
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.