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?
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}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.