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

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
Published Nov 27, 2018 in Portfolio for Jira

Introducing a new planning experience in Portfolio for Jira (Server/DC)

In the past, Portfolio for Jira required a high degree of detail–foresight that was unrealistic for many businesses to   have–in   order to produce a reliable long-term roadmap. We're tur...

2,984 views 19 22
Read article

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