I am using Jira Cloud and trying to use a ScriptRunner Validation in a workflow.
I am using this script:
cfValues['Acceptance Criteria'].length > 10
But when I do, I get this error:
Evaluation failed: "cfValues" - identifier not available in context
In the ScriptRunner docs, it shows numerous examples using cfValues[]. What am I missing?
After much searching around, took a different approach based on some code found in the jira-expressions-type-reference doc and this works:
let plainTextValue = value => typeof value == 'Map' ? new RichText(value).plainText : value ;
(issue.customfield_10227 != null) && (plainTextValue(issue.customfield_10227).length > 10)
But I'd still like to know why cfValues throws an error because it seems like a much more straight forward way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.