Make a custom field visible/mandatory only when another custom field has a specific value

Athira Krishnan November 25, 2024

Hi,

 

I need a custom field to appear only when another custom field has a certain value.

For example:

If "custom_list" is a single select dropdown with possible values 1, 2, 3, 4

I need the user to add a value to "new_field" only when custom_list value is 1

 

I use Jira Premium. Is there any way to achieve this?

4 answers

3 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2024

Hi Aitrhira,

I can confirm you could make a field required when option 1 is selected inside a select list field using the Behaviours feature provided by ScriptRunner for Jira Cloud.

We have an example in our Script Library here, which shows how to do this.

Please note that currently, Behaviours only works on Jira Software company-managed projects, as documented here.

I hope this information helps.

Regards,

Kristian

Athira Krishnan November 25, 2024

Thanks, I don't have ScriptRunner though.

 

Is it possible to do the same with conditions or validators in the workflow?

Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2024

Hi,

It could be possible with Validators, but you would need an add-on out of the box to provide the ability to validate this, as I do not believe Jira has validators to do this out of the box.

Regards,

Kristian

3 votes
Marc - Devoteam
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.
November 25, 2024

Hi @Athira Krishnan 

OOTB you can't do that.

You'll need an add-on, such as scriptrunner.
With scriptrunner you can set field behaviours on transition screens (conditionally show/hide/set mandatory).

Marc - Devoteam
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.
November 25, 2024

HI @Athira Krishnan 

With Workflow conditions and validations, this is not possible.

Only If you would have a 3rd party marketplace app to extend your workflows with scripts, like JMWE, JSU, or scriptrunner, 

0 votes
Maciej Dudziak _Forgappify_
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.
February 12, 2025

Hi @Athira Krishnan 

I’m from Forgappify and wanted to share that we’ve been working on a more flexible way to build conditions using Jira Expressions. This led to the Ultimate Validator (now in Beta), which is part of the Workflow Building Blocks for Jira app. It lets you use most of the power of Jira Expressions—but without writing code. Instead, you build conditions through a simple UI Here’s how the configuration for your case would look:

required_field_based_on_custom_field.png

I hope it will help.

Cheers

0 votes
Nacho Moreno Ortega
Contributor
November 26, 2024

Hello Athira Krishnan,

I am Nacho and i am part of the Decadis team.

Is it a possibility for you to use a third party app?

If so, i would like to recommend you our app Jira Workflow Toolbox Cloud.

This app contains many workflow functions that can be used for for many different cases, for example the one that you mention to validate that a custom field is mandatory if another custom field has a specific value.

For this purpose, a Jira expression validator can be created with the following expression:

issue?.customfield_nnnnn?.value == "Option 1" ? issue?.customfield_yyyyy != null : true

 "nnnnn" should be replaced for the custom field id of the Select list (single choice) and "yyyyy" should be replaced for the custom field that must be mandatory if "Option 1" is selected.Screenshot1.png

If you need more information, please feel free to create a ticket on our support portal.

Best regards,

Nacho

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events