Hi all,
after trying a lot with Field Required Validator with optional validation I hope to find the answer here.
Following scenario:
Thank you for help!
Hi @Anette Noll , with the OOTB Field Required Validator, if there are two fields involved it will always be an AND operation. There is not an OR validator natively. If you want to allow a transition if either field A OR B is not empty then you need an addon app.
Hi @Anette Noll,
Your requirement can be achieved using the Jira Misc Workflow Extensions (JMWE) app.
Solution:
!!issue.customfield_10081 || !!issue.customfield_10004
Replace 10081 and 10004 with the IDs of fields A and B from your instance. The above expression returns false if both A and B are empty. It returns true in all other cases.
Try the above in your instance. If that doesn't work, let me know the types of the two fields so I can tweak the above script for those field types.
BTW, I'm from Appfire, the vendor of JMWE app. If you've any questions on this, feel free to create a ticket with our support team here.
Regards,
Suprija | Appfire
Hi @Anette Noll
It should be pretty simple in any jira expression-based validator. If either field A or B must be not empty:
issue.customfield_10004 != null || issue.customfield_10005 != null
Change ID to correct ones for your Jira instance.
I am from Forgappify, and we developed Jira Expression Validator, which is part of the Workflow Building Blocks for Jira free app. In the expression editor, when you start typing the name of your field, you will get a suggestion for the ID.
For some types of fields you, expression maybe slightly different, e.g. for array types you may need to use:
!!issue.customfield_10004?.length
I hope it will help.
Cheers
Hi @Jack Brickey
thank you for reponse.
Probably you mean JMWE app?I already use itNo, chance to describe it in the optional validation?Or are you speaking of another addon app?
Hi @Anette Noll , good to know that you have JMWE. I believe you can achieve with JMWE but I do not have sufficient personal experience with it. However, let me see if I can assist with a bit of Community searching. I encourage you to do the same ... two heads better than one 😉
From my brief research you will need to build your own scripted validator. Other than the documentation link just provided there are examples of similar scenarios. One such example is below.
JMWE-plugin-multiple-choice-custom-field-validator
In my experience, the appfire team, and other community members are quite helpful with JNWE scripts. Hopefully one such individual will jump in here with an exact answer.
in the meantime, if you figure it out, please do post the exact script that you used as it will help others in the future.
Thank you so much, @Suprija Sirikonda _Appfire_ .
It works.
It looks like you're new here. Sign in or register to get started.