Hello,
We define a workflow validator with Scriptrunner, to allow the transition only if a custom field (text field, with Wiki Style Renderer) is not empty.
The Jira expression is:
issue.customfield_10052 != null && issue.customfield_10052.trim().length > 0
The validator is OK when we test it from Scriptrunner Workflow Overview:
The validator works correctly when we transition the issue from a board.
But when we want to transition the issue from the issue view, we get this error:
"errorMessages": [ "Evaluation failed: \"issue.customfield_10052.length > 0\" - operator \">\" is not applicable to types: null and Number" ]
and the error message popup is displayed:
Can you please help me understand why the behaviour is different in both views and how to fix this, so that the validator works wherever the transition is done?
Thanks.