Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2023
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 edited

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 • 2 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 edited

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
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events