Exception on scriptrunner scripted condition in workflow

I have a simple script condition in a workflow:

issue.subTasks.any {!(it.resolution > 0)}

The idea is to allow the transition only when at least one subtask is unresolved. When this condition is true the logs show an entry, but when it's false (i.e. all subtasks are resolved), I see this error:

2014-02-21 11:41:13,209 http-bio-8080-exec-11 ERROR [groovy.canned.utils.ConditionUtils] javax.script.ScriptException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String

However the transition is disabled for the user.

Any idea why that casting error in that case?

1 answer

1 accepted

0 votes

Just use

issue.subTasks.any {!(it.resolution)}

I think you probably wanted it.resolutionId, but that's a String value (which always has something that looks like an integer, but is not one), so you can't use "greater than".

Actually this is clearer:

issue.subTasks.every {it.resolution}

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,794 views 11 18
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot