Display a custom field values ​​based on value of another

DanielG
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.
June 6, 2013

Hi,

As I say in title of this question I want to have in Jira one custom field that display some values based on value of another custom field.

For example, I have one Custom Field 1 with values '1' and '2' and another Custom Field 2 with values 'A','B','C' and 'D'.
I want that if user select '1' in Custom Field 1, then display only values 'A' and 'B' on Custom Field 2, and if user select '2' then display only values 'C' and 'D'.

It is possible in JIRA?

Thanks in advance,

Daniel

4 answers

1 accepted

0 votes
Answer accepted
PhilB June 6, 2013

The cascading select field that is built into Jira can do this.

If you need something more complex that what the built-in field offers I would suggest looking at the existing third-party Plugins.

If you can't find what you need there, building a custom plugin that does what you need is certainly something that can be done.

DanielG
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.
June 7, 2013

It's not possible with Script Runner Plugin?

2 votes
Onkar Ahire
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.
June 7, 2013

I think you should created a scripted field for Custom field 2 for reflecting the changes depends on custom field 1

eg.


1 ) Download Script Runner Plug in.
2 ) Create a "Scripted Field" Custom field
3) Go to Admin >> Script Field>> Edit the custom field which you have
recently created.
4 ) Below is an example which select the value from select custom field and
push it the same to Scripted field.

eg code : -

here I am returning the value of Select custom field to sctipted field.


def select = getCustomFieldValue("Select")
if (select) {
return select
}
else {
return null
}

// This script return the value which you have selected in Select custom field, instead you can

// redefine the code as per your requirement.

Cheers

Onkar Ahire

Onkar Ahire
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.
June 7, 2013

@ Daniel >> You can create using sciptrunner plugin above eg is helpful for you.

DanielG
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.
June 10, 2013

Thanks Onkar! Tomorrow I try to implement and I tell to you!

Cynthia Susairaj November 18, 2016

Script runner is a paid plug in. 

0 votes
Paul Shin August 26, 2013

Hi Daniel,

Were you able to implement your requirement?

I'm trying to do the same, and Onkar's example above does not seem to provide a select list for the second custom field. It only sets the field value. I want to give options to users instead. How did you implement a select list field that has different options (A and B if the first custom field has 1. C and D if the first custom field has 2.)?

0 votes
RambanamP
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.
June 9, 2013

do you want to hot code custom field optios are do you want to display values from external DB?

if you are hotcoding options then use Cascading customfield.

if you want to display options from external DB, use the following plugin

https://marketplace.atlassian.com/plugins/org.deblauwe.jira.plugin.database-values-plugin

DanielG
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.
June 10, 2013

rambanam my values are predefined and don't read from external DB, but thanks for your help! I don't know if in future I want to read from external, so I remember this plugin if I want to do this! Thanks!

Suggest an answer

Log in or Sign up to answer