Custom user field - Required under certain condition

Anette Noll December 4, 2022

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
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2022

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.

Anette Noll December 6, 2022

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
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 6, 2022

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") 
Anette Noll December 8, 2022

Hi @David Fischer 

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

Custom user field - Required under certain condition.PNG

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 8, 2022

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2022

Hi @Anette Noll ,

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

These kind of conditions are problematic in cloud.

Anette Noll December 4, 2022

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
AUG Leaders

Atlassian Community Events