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

This widget could not be displayed.

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 Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

254 views 1 3
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