Exception on scriptrunner scripted condition in workflow

Adolfo Casari
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 Leaders.
February 20, 2014

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
Answer accepted
JamieA
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 Leaders.
February 22, 2014

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

JamieA
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 Leaders.
February 25, 2014

Actually this is clearer:

issue.subTasks.every {it.resolution}

Suggest an answer

Log in or Sign up to answer