Forums

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

Creating subtask via scriptrunner - Condition not working

Rob B
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, 2020

Im creating a subtask via script runner depending on a custom field (numeric field). It shouldnt create it if the value is 0. 

Condiition: 

(cfValues['Custom Field'] as int) != 0

Examples like 0.9 or -0.9 are not creating sub tasks either. Can any please advise.

Thanks

1 answer

1 accepted

1 vote
Answer accepted
Nic Brough -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, 2020

It's the casting of the double to an int.   0.9 as an integer is 0.

I suspect you can simply remove the cast (drop the "as int")

Suggest an answer

Log in or Sign up to answer