change drop down value of custom field based on status

I want to change drop down value of custom field based on status.
For eg:
If status is StatusA, then value in drop down should be A1,A2.
If status is StatusB, then value in drop down should be A1,B1,B2.
How can i achieve this?

3 answers

1 accepted

You can use the JJupin plugin for that with its Live Fields fieature. Here's a similar example to what you're looking for:

http://confluence.kepler-rominfo.com/display/TR/Restricting+resolutions+based+on+issue+type

Its Not working for me. Do we have any sample code for help?

0 vote
Mizan Community Champion Apr 24, 2013

You can use Behaviours plugin for this , You will need to write a custom groovy script which will check for the status and display options in the required customfield .

refer the below docs for examples

https://jamieechlin.atlassian.net/wiki/display/JBHV/JIRA+Behaviours+Plugin

https://jamieechlin.atlassian.net/wiki/display/JBHV/Miscellaneous+Behaviours+Examples#MiscellaneousBehavioursExamples-Addorremoveoptionstosingleormulti-selectfields

is it possible via javascript?

Will script runner plugin be used instead of Behaviours plugin?

Mizan Community Champion Apr 25, 2013

It wont be possible via javascript since the status is not present on the screen/pop up

Mizan Community Champion Apr 25, 2013

Script runner cannot cannot be used to change the values of a dropdown on the screen , script runner can provide a post function which will set the value to the customfield based on status

Using behaviours plugin for this type of customization is better than pasting javascript in the fields description

hi!!

you can use Database Custom Field (https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.databasecf) and a auxiliar database table with the relationship between status and drop down field.

The database table will have the following values:

Status A - A1

Status A - A2

Status B - A1

Status B - B1

Status B - B2

So, the query will be dependant on status field :-)

Hope this helps.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

172 views 1 17
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