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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

672 views 3 11
Read article

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