Hi,
Looking for a ScriptRunner workflow validator for one of my Jira Cloud sites.
Prefer to use the ScriptRunner Validator so I can customize the error message.
Hi William, nice to meet you here.
Please use this script to validate the custom field.
def customField = getCustomFieldValue("Your Custom Field Name") if (customField ==~ /^(?i)prodid[0-9]+$/) { return true } else { def errorMessage = "Invalid format. Please ensure that the first 5 characters are a case-insensitive 'prodid' followed by one or more numeric characters." setValidationErrorMessage(errorMessage) return false }
Thanks.
Felix M.
Hi Felix,
Nice to meet you and thank you for the quick reply.
Solution not working for me. I tried putting this code into a ScriptRunner Cloud workflow validator extension and see the following:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Guess what I am looking for is something like this:
issue.customfield_10038 == ("/^(?i)prodid[0-9]+$/]")
The above does not work, but how to have the custom field check against a regular expression
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.