Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Making fields required based on other field response in Jira Cloud

Koushik
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!
August 28, 2024

Hi All, 

In Jira cloud I have two custom fields with dropdown yes or no values.

If I select Yes in any of the fields then other three custom fields should become required.

I need this to be done in create screen while creating a ticket.

We are using script runner pulgin in our instance and required specific groovy script for the above requirement.

 

Thanks in Advance.

2 answers

Suggest an answer

Log in or Sign up to answer
2 votes
Valerie Knapp
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 28, 2024

Hi @Koushik , welcome to the Atlassian Community and thanks for your question.

I tagged this post with some useful tags for Adaptavist, who make ScriptRunner, and for Behaviours, which is what I think you will need to use to achieve this.

I would typically refer to the documentation for how to get started here - https://docs.adaptavist.com/sr4jc/latest/features/behaviours/create-and-edit-behaviours 

Furthermore, Adaptavist has a script library available where you can search to find if there is already a script that you could use as-is or modify to your use case. Please check here - https://library.adaptavist.com/search?library-content%5BrefinementList%5D%5Bapp_pretty_names%5D%5B0%5D=ScriptRunner%20for%20Jira&library-content%5BrefinementList%5D%5Bplatforms%5D%5B0%5D=cloud&library-content%5BrefinementList%5D%5Bfeature_names%5D%5B0%5D=behaviours 

How we generally work in the community is that we are offering advice or support, not necessarily to write the entire thing for you, as that would generally be considered paid consultancy.

If you can show a bit what you are working on and towards, we will try to help you to achieve it, not necessarily to do it for you.

Hope this helps you.

Cheers

1 vote
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.
August 29, 2024

Hi Koushik,

We have the example located here which shows how to make a field required when a value is selected in a Select List field.

You will be able to modify this example to achieve your requirement of making your three fields required when Yes is selected in your drop-down fields.

To achieve your requirement you would want to have the isRequired Variable twice with different names where each variable checks one of your dropdown fields to see if it has the value yes.

You would then copy the statement at the bottom of the script that makes the field required and have one statement for each field if either of the isRequired variables is true.

I hope this helps.

Regards,

Kristian

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events