I have a workflow that is shared by many projects (60+), but I have 5 projects that the customer is requesting a particular field be required when the other projects don't want that field to be required. I was thinking I could use the JMWE Field Required Validator to make the field required on a transition only when the issue the user is working on is from a particular project.
I tried this expression:
project == A || project == B || project == C || project == D || project == E
but when I test it on a defect from E it fails on A.
Is what I'm trying to accomplish even possible?
Hello @Lori Milam
Looking at the example provided here, I suggest that you try replacing project with issue.project
https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/466226183/Build-your-own+scripted+Validator
Thank you but doing this didn't make a difference. It still fails on A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How about issue.project.name or project.name?
Looking at the information available on these pages:
https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#issue
https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference/#project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you also need to have quotes around the values:
issue.project.name == 'First Project Name' || issue.project.name == 'Second Project Name'
Or it seems you could use the project key also:
issue.project.key == 'FPN' || issue.project.key == 'SPN'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes! This is the final expression that works.
issue.project.key == 'UKBT' || issue.project.key == 'UKAP' || issue.project.key == 'UKPAY' || issue.project.key == 'RULES' || issue.project.key == 'UKIC'
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Lori,
Did you qualify the expression?
{{issue.project}} - the project this issue is a part of.
Can you show us a screenshot of the postfunction?
Regards
Ralf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not a post function but a Field Required Validator. I didn't wrap with {} but I did qualify.
issue.project == UKBT || issue.project == UKAP || issue.project == UKPAY || issue.project == RULES || issue.project == UKIC
Thank you for responding.
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.