Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Increase Value of Field post-function - Conditional script question

Donncha Daly
Contributor
March 9, 2018

Hi,

I am a complete newbie when it comes to scripts so my apologies if this something stupid

I'm trying to increase the value of a Number Field by using the 'Increase value of field (JMWE add-on)' post-function. I only want to do this when another Single-Select Field (Pushback Tracker) has the value 'Yes' selected so I have inserted the following code in the Condition field of the Post Function

def passesCondition = false

if (cfValues['Pushback Tracker']?.value == 'Yes') {
passesCondition = true
}

return passesCondition

Unfortunately it doesn't seem to work and when I test it using the 'Test Groovy Script...' button I get the error message below. Can anyone help? I know it's probably something stupid, but this code worked in a different post-function and I don't understand why it's not working here.

There was an error during the execution of your script

Message:
groovy.lang.MissingPropertyException: No such property: cfValues for class: script1520588315893414083605

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
March 9, 2018

I encourage you to read the JMWE documentation, which explains all this in details. For example, to figure out how to access fields of an issue, refer to: https://innovalog.atlassian.net/wiki/x/dgDBBg

In your case, the script could be:

issue.getAsString("Pushback Tracker") == "Yes"
Donncha Daly
Contributor
March 9, 2018

Thanks for your help, this worked. I had been looking at the wrong documentation.

Suggest an answer

Log in or Sign up to answer