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

Joshua Villanueva
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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?

 

1 answer

0 votes
Jovin
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.
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.

Suggest an answer

Log in or Sign up to answer