Basic Script to allow a Custom Field condition

jjgalea January 8, 2017

Hi,
 

I would like to create a condition on a workflow transition. 

When a transition is moved from 'Review' to 'Approved', I would like to create a condition using Groovy Script Runner.

The condition should be;

"If amount is 100 or less"

The custom field is Numeric Field.

 

Can someone please help me create this short script?
 

Cheers,
Jason 

1 answer

1 accepted

1 vote
Answer accepted
Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2017

Hi Jason,

Try something like 

cfValues['Number CF'] <= 100

You can also Expand examples in the Condition that you can check.

regards, Thanos

jjgalea January 8, 2017

Thanks Thanos for the prompt reply.

For some reason I am getting the error below

image2017-1-9 11:27:7.png

 

Thanos Batagiannis _Adaptavist_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2017

You can ignore this error, it is because it doesn't "know" that the cfValues holds a number. 

Try it and let me know.

regards, Thanos

Suggest an answer

Log in or Sign up to answer