Forums

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

How to make a field required before transition for specific issues?

Joshua Villanueva July 5, 2024

Hello,

 

I'm trying to make a field required before allowing the issue to transition to "approved." However, I need this to only apply to issues with specific values in one of the custom fields in the issue.

 

So in my case, I have an issue type that has custom fields "list of Instructions" and  "Product" with choices A,B, and C. I want a validator that will require the custom field "List of Instructions" to be mandatory for the issue to transition, but only for issues where "A" or "B" is selected for "Product" field. 

Any ideas how to go about with this?

 

2 answers

1 accepted

0 votes
Answer accepted
Jovin
Community Champion
July 5, 2024

Hey @Joshua Villanueva 

You can absolutely do this via Conditions on the transition! This will ensure that the transition is not visible unless your criteria is met. For this your criteria is:

  1. List of instructions IS NOT EMPTY AND
  2. Product = A OR Product = B

See below screenshots of how this would look (I've used Components for Product, and Environment for List of instructions).

conditions.png

  1. Add your first condition (List of instructions) choose the operation as != and leave the rest empty.
  2. Add your second condition (Product) and choose the operation as = and input the option ID for option A (see below for how to get Option ID).
  3. Click the fork icon in the screenshot below and repeat step 2 there but for Option B.
  4. Change the "All of the following conditions" for the grouped ones to "Any"

or.png

Getting the Option ID: You can find this by going to the custom field config, finding your field then clicking the ... and opening Contexts and Default Value, then editing on the options, then edit on the specific option. In the URL you'll see ?fieldConfigId=10107 - the 5 digit number is the ID.

0 votes
Joshua Villanueva July 11, 2024

Hi @Jovin 

Thank you for your response. Just to clarify, if I use these conditions, The issue can transition fine(without conditions) for choice C in Product custom field?

 

Simply put, i only need this condition to apply for A nd B, not C. thanks

Jovin
Community Champion
July 13, 2024

Hey @Joshua Villanueva 

Yup - in the grouped condition if you add one for each of the 3 all will be required, if you only add 2 of them, then only those two will be required!

Like Joshua Villanueva likes this

Suggest an answer

Log in or Sign up to answer