It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating subtask via scriptrunner - Condition not working

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

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
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you