Hi Team,
We have two number custom fields when issue is getting transitioned to next stage we wanted to increment 1st custom field value and decrement second custom field value using script runner post function.
Right now using below script for incrementing the value but its not working.
def currValue = (Double)issueInput.fields.customfield_10051 ?: 0 issueInput.fields.customfield_10051 = currValue + 1.0
There are so many answers for the same question in server but we want this to implement this in cloud
Thanks in advance!!
Hi @Janaki.R
I'm not 100% sure how you can do this in ScriptRunner, however if you're using Cloud you could quite easily do this in an automation rule.
The trigger would be the transition, then you could use the Edit Issue action containing something like:
{{#=}}{{customfield_10051}} + 1{{/}} - This uses the math expression smart value to add 1 to the current value within customfield 10051
Hi @Callum Carlile _Automation Consultants_ ,
Thanks for your reply
Yeah, i am aware that this can be achieved by automation but the issue is when the value is getting incrementing the issue should automatically transits the next stage so i have written two automations one for incrementing the value and second one whenever value is changing and it satisfies particular condition it should move to other state. This automations are working fine induvidually and i wanted to trigger this rules parallely but at a time only automation is working. so i wanted to change incrementing the value with script runner and moving the transition if condition satisfied with automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Janaki.R Ah okay, fair enough.
I'm not sure why the automation rule might not be working, but just one thing to quickly check - have you checked this checkbox on the second one that's triggered off the first one? This is required when one rule is triggering off the action of another rule
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Callum Carlile _Automation Consultants_
Awesome!! I missed to check that box after checking that two automations are working as expected.
Thanks for your help
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.
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.