Hi Team,
I have a use case , I cannot find to create a good validator with JMWE in Jira Cloud on Create transition.
I would like to allow ours users to create an issue only on specifics combinaisons of a CF(Select list) and Components.
I use JMWE with this validators : "Build-your-own Validator"
| CF_A | Component | Result condition |
| select list | A | B |
| 0 | 0 | 0 | True |
| 0 | 0 | 1 | True |
| 0 | 1 | 0 | True |
| 0 | 1 | 1 | True |
| 1 | 0 | 0 | True |
| 1 | 0 | 1 | False |
| 1 | 1 | 0 | False |
| 1 | 1 | 1 | False |
(My Validator is on field issue Type : if issueType = Bug => block ...and we are on Bugs's Workflow.
So if condition return True => Block , if condition return false, we skip the validator and user can create the issue)
So for exemple:
If my Selectlist = "0" and I have component = "A" , my condition return "True"
So my Validator block the creation
If my Selectlist = "1" and I have component = "B" , my condition return "False"
So my Conditional validation skip the validator and the creation is allow
I try this for my conditional Validation :
(issue.customfield_10054.value == "1" && (issue.components.some(it => it.name != "A"))) || (issue.customfield_10054.value == "1" && (issue.components.some(it => it.name != "B")))
But It's not ok, still return "True"
I think because we are still one or other option .. True.
We cannot use if/else in Validator condition ( only in postfunction) right ?
So I don't know how to do this , any help are appreciate 