Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Make a field mandatory in workflow validator JMWE

Lori Milam
Contributor
November 7, 2023

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?

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
November 7, 2023

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

Lori Milam
Contributor
November 7, 2023

Thank you but doing this didn't make a difference. It still fails on A.

Trudy Claspill
Community Champion
November 7, 2023
Trudy Claspill
Community Champion
November 7, 2023

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'

Like Ralf Fehling likes this
Lori Milam
Contributor
November 7, 2023

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!

Like # people like this
0 votes
Ralf Fehling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2023

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 

Lori Milam
Contributor
November 7, 2023

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events