Scriptrunner workflow validator behaves differently when transition from board or issue view

Emilie
Contributor
February 10, 2025

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:

validator.png

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:

validator-2.jpg

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.

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events