The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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 Champions.
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

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 Champions.
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")