Conditional field in JIRA

I hava to different fields:

 

  • One field called ‘Kundi’ of type ‘Database information’ (Has the ID: 11407)

 

  • One field called ‘Undirskipan’ of type ‘Select List (single choice) (Has the ID: 11810)

 

I would like that the field ‘Undirskipan’ is only visible if the field ‘Kundi’ has the value ‘TAKS’ (TAKS is one of the elements possible to choose from the list)

 

Could someone help me achieve this?

2 answers

This widget could not be displayed.

You'll need to inject javascript to do that, but doing it manually is an unsupportable and unreliable nightmare.

You'll be better off using the Behaviours module in Script Runner to do it, although I'm not 100% sure it will work with whatever you mean by "database field"

I think Power Scripts for Jira help you easily do this

Alexey Matveev Community Champion Jan 03, 2018

As far as I inderstand there are 2 addons which can help you Adaptivist ScriptRunner with the behaviour functionality and Power Scripts with the live fields functionality. Each of them has own advantages. But you would need to answer Nic's question about the Database Information field. What kind of field is it?

It is a ‘Select List (single choice). The list is being populated via SQL therefore the "Database Information" type.

But it is a simple dropdown feature

What add-on is providing it though?

This widget could not be displayed.
Alexey Matveev Community Champion Jan 03, 2018

1, If you use Power Script, you could create a live field with an entry point

lfWatch("single select", {"Kundi"}, "setSingleSelect.sil");

and your setSingleSelect.sil would look like this

if (contains(argv["Kundi"], "TAKS")) {
  lfShow("Undirskipan");
} else {
   lfHide("Undirskipan");
}

2. If you have Adaptivist Scriptrunner, you would need to create a behaviour and your script would look like this

CustomField kundiField = getFieldByName("Kundi")
CustomField undirskipanField = getFieldByName("Undirskipan")
if (kundiField.getValue().equals("TAKS)) {
undirskipanField.setRequired(true)
} else {
undirskipanField.setRequired(false)
}

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

578 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you