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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,644
Community Members
 
Community Events
176
Community Groups

Custom user field - Required under certain condition

Hi all,

does Jira  allow an out of the box solution for this?

  • custom user field is only required if reporter is in role "x" 

    OR

  • custom user field may not be empty if reporter is in role "x"

 

3 answers

2 votes

Hi @Anette Noll --

Unfortunately the only validators offered by out of the box do not let you check user roles for making a field required (or not).

https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-validators-for-company-managed-projects/

To validate based on user role, you'll need a third-party add-on such as:

You may end up needing to learn a little bit about Jira Expressions - if you have problems, you can always ask here in the community, or from the vendor.

Hi @Darryl Lee 

JMWE is such an integral part of Jira that I have forgotten to see it as a third-party-add-on, i.e. this is available.

Can you help with the expression in this case?

0 votes

Hi @Anette Noll ,

using JMWE for Jira Cloud, you can use a Field Required Validator (JMWE app), select the field that must be required, and add a "conditional validation" Jira expression like:

issue.reporter.getProjectRoles(issue.project).some(pr => pr.name == "Developers")

If you are using this on the create transition, you can use this as well:

user.getProjectRoles(issue.project).some(pr => pr.name == "Developers") 

Hi @David Fischer _Appfire_ 

unfortunately it does not work (I use it one the create transition):

Custom user field - Required under certain condition.PNG

Hi @Anette Noll 

Is the field required for all users if you remove conditional validation?

And when you say it doesn't work, what does that mean exactly?

0 votes
Hana Kučerová Community Leader Dec 04, 2022

Hi @Anette Noll ,

when exactly do you need this? What is your use case?

These kind of conditions are problematic in cloud.

Hi @Hana Kučerová 

we collaborate via Jira with customers and suppliers, but want to avoid that customer directly contacts supplier nor should supplier be able to contact customer.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events