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,464,911
Community Members
 
Community Events
176
Community Groups

Required field and condition

What's the best way to make a field required depending on a condition to another field?

 

I want to require the field Root-Cause-Analysis, but only for Type = Incident, with priority 1, 2, 3

 

So: Not required for other ticket-types, and not for priority 4.

 

2 answers

1 accepted

1 vote
Answer accepted

Hi,

If you are on a server, not cloud, the Scriptrunner addon allows you this feature.

You can use behaviour and a script on a field in behaviour to achieve what you want. I've used this, and it works great. Then you get the red * on the field when it is required too, instead of error message after you send the form - if you you use validator in the workflow.

Scriptrunner: https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner/server/overview
Behaviours doc: https://scriptrunner.adaptavist.com/latest/jira/behaviours-overview.html

For code to set required based on another field - se answer in: https://community.atlassian.com/t5/Answers-Developer-Questions/ScriptRunner-Issues-with-required-custom-field-based-on-another/qaq-p/546310

 

Hope this helps. Note that Behaviours are not available for Cloud - you have to use a different addon, or the validator in Workflow transition. 

I'm on a server, so I'll try this on some friday afternoon... thank you!

Can you please suggest the addon or the validator for Jira Cloud.
Thanks.

Hi @Moin 

I am sorry, but I do not have much hands-on experience with the different workflow app's for Jira Cloud.

Since the original question on this page is marked as answered, I would recommend you to create a new question in this Community asking for suggestions to solve the needs you have in Jira Cloud. I am certain that there are others in the Community that have experience in what you are after. You might get more views from people that can help if you have a unanswered question.

What about cloud version?  Is this not possible?

I am new to Script Editor. I added the script, but doesn't look like it is working.

I added new behavior, added the field(radio button) and added Service side script. My environment is JIRA server. Any help is much appreciated. I am missing any configuration setting for the 1st time use?

Suggest an answer

Log in or Sign up to answer