I am trying to check for the custom field "Create sub-tasks" which is a radio button and has the following value - None, Yes, No. I want to add a validator to check if the value is either Yes or No. However, when I have placed the validator, it shows me some errors.
Here is my custom field - Create sub-tasks.
Here are the errors I get.
Hey @shreyasjoshi11 - I think you're using Workflow Enhancer for Jira, yes? Huh, their validator syntax looks similar to Jira Expressions (on Cloud), but I now realize this is a DC/Server app. Neat.
So anyways, when you create a custom field of type Radio Button, if it is not set to be Required, then the "None" option shows up automatically.
But as @Alex Koxaras -Relational- correctly points out, it holds a value of 'null'.
But because you want the validator to "pass" if the custom field is NOT null, I think you need to check for the converse:
{Create Sub-tasks} != null
It says - Parsing of the expression has failed. Please check its syntax. You entered: {Create sub-tasks} != null. This expression will always evaluate to <b>false!</b> System message: Lexical error at line -1, column -1. Encountered: "-" (45), after : "{Create sub"
I am using -
Yes, it is hosted on the server rather than the cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, ok, looks like this add-on doesn't support the word 'null'. I got it to work with an expression like this:
{Create Sub-tasks} != ""
Please let us know if this works for you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still it doesn't work -
Parsing of the expression has failed. Please check its syntax. You entered: {Create Sub-tasks} != " ". This expression will always evaluate to <b>false!</b> System message: Lexical error at line -1, column -1. Encountered: "-" (45), after : "{Create Sub"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hrm. It might be case-sensitive. Try:
{Create sub-tasks} != ""
(I got your field name wrong.)
(Also it maybe doesn't like the -. Can you also try:
{Create sub\-tasks} != ""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ooof, I gave that a try and it also did not work. You probably should contact TNG Technology's support since this is their add-on.
Or maybe @TNG Technology Consulting GmbH might be able to weigh in on this here for those of us who are interested.
The question is why in Workflow Enhancer for Jira @shreyasjoshi11 is unable to create a Universal Validator with a field name that contains a hyphen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @shreyasjoshi11,
We are sorry to hear that you experience issues with Workflow Enhancer for Jira. Thanks @Darryl Lee for mentioning us.
Unfortunately, I am not able to reproduce your issue locally. Referencing fields that contain a hyphen works fine for me.
May I ask you a couple of questions:
If this does not help, may I ask you to open a support ticket at https://tngtech.atlassian.net/servicedesk/customer/portal/16? Then, we can have a closer look together.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Huh - really odd. I could exactly replicate @shreyasjoshi11 's issue by renaming my field "Create sub-tasks". Well, I look forward to finding out whatever the fix is. Thanks for the response, @Matthias Bertsch [TNG Technology Consulting] !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @shreyasjoshi11 ,
I'm not familiar with the specific app, but you could write the expression like:
{Create Sub-tasks} == null
It would be helpful if you could specify the app which you use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It says - Parsing of the expression has failed. Please check its syntax. You entered: {Create sub-tasks} != null. This expression will always evaluate to <b>false!</b> System message: Lexical error at line -1, column -1. Encountered: "-" (45), after : "{Create sub"
I am using a universal validator and my JIRA is hosted on the server and not cloud.
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.