on a workflow from status A to status B
I want to have RCA field as mandatory if labels contain "regression" and "stg"
on that workflow, I tried using power script as condition as used below jira expression
then on the validator tab added validator that RCA field != empty (using 'Field Required Validator')
the problem:
1. RCA was always mandatory and didn't check the condition of certain labels
+
2. status B didn't appear on the statuses option list
what did i do wrong?
issue.labels.contains("regression") && issue.labels.contains("staging")
Hi @Yuval Bar Lev ,
From my POV, I think you should fix it as issue.labels.includes and use the workflow validator as here:
(issue.labels.includes("regression") || issue.labels.includes("stg")) ?
issue.customfield_10423 != null :
true
For status B doesn't appear on option list is maybe because you might have set up the workflow condition instead of validator.
I hope this can help and meet your requirement
Kind regards,
thank you very much, very helpful @Khang Bui_Candylio
1. so i should use only validator as you showed, and not have condition at all?
2. the below line you wrote, represent the RCA field that i want to make sure is not null? how do i know the field ID ('customfield_10423') for other fields?
3. if i want to have more then one field to validate is not null, i just add another row like the one below?
issue.customfield_10423 != null :
Jira will force this validation only when the labels exist?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Yuval Bar Lev ,
1. It's best practise to use validator if you want to validate fields and you will need a transtion screen from status A to status B
2. You can check customfield id by go to Settings > Issues > Custom fields > *Edit context* > You'll see a row of number on the URL
3. It's best for you to use the product's documentation.
I hope this information is helpful
Kind regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.