Transition based on custom field number value

SMAtlassianMber
Contributor
November 14, 2018

Is it possible to move an issue to Done if custom field number field "One-Time Cost" is under $11,000?

Option A) ScriptRunner Fast-track transition an issue based on the number field value

 I'm getting the following error for: cfValues['One Time Cost'] as Integer < 11,000

The script could not be compiled <pre>org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script97.groovy: 1: expecting EOF, found '(' @ line 1, column 37. cfValues['One Time Cost'] as Integer < 11000 ^ 1 error </pre>.

Option B) Using JMWE for Jira Server: Transition issue based on a Conditional execution. Any Suggestions?

 

1 answer

0 votes
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 17, 2018

Hi,

With JMWE, you can use the conditional execution option of the transition issue post-function with the following condition:

issue.get("One-Time Cost") >= 1000

SMAtlassianMber
Contributor
November 19, 2018

Hello David - I have added the following to transition 131 that should trigger the next transition 141 based on the conditional execution, but nothing happens.  

Transition 141 will be triggered on the issue.

Fields:
Resolution:Accepted
Comment:the following text: Proposal amount under $11,000 no additional approval needed. .


Run this post-function conditionally. issue.get("One-Time Cost") <11000

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2018

Did you first test without conditional execution, to make sure everything is set up properly?

And then, did you test the script using the Test Groovy Script button on top of the editor?

SMAtlassianMber
Contributor
November 19, 2018

Even without the conditional execution the jira issue does not transition to the next status as outlined. I did test the script and got not errors.

Maybe I am not understanding this JMWE function. My understanding is if I move an issue to from In Progress to Approve using transition 131 and the amount in One Time Cost is under $11,000, the issue should move to Done via transition Accept 141, but nothing happens.

 

JMWE Transition current issue.PNGConditional Execution.PNG

SMAtlassianMber
Contributor
November 19, 2018

I just relaunched a new Jira session and now it's working perfectly.  Thank you so very much for all your help. 

Suggest an answer

Log in or Sign up to answer