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

Can two jira custom select fields use the same list of options?

Brent Webster
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.
October 6, 2015

I have a requirement to have two custom single select fields with the same set of options.  I know under the JIRA hood, the option names may be the same but the option ids are different.  The fields are used at different parts of the process but have the same set of options.  The list is contains over 20 options and I would really like to only maintain one list of options used by both fields? 

I've been experimenting with the Behavior addon and some groovy scripting but not much luck.  I've been able to  limit the selection of options at different parts in the workflow process but that means initially creating a custom select field with all the options defined and then use the script to limit which options are visible.  I really want to create a dynamic list of option via some functionality in ScriptRunner/Behavior

I'm running JIRA 6.4 and ScriptRunner 3.0.11.  Any ideas?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Jeff Louwerse
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.
October 6, 2015

you could use the "database customfield plugin" to do and have two dbcf customfields that use the same set of options. 

https://marketplace.atlassian.com/plugins/com.keplerrominfo.jira.plugins.databasecf

Brent Webster
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.
October 6, 2015

Interesting but I was hoping to solve my problem with my existing ScriptRunner plugin.

Jeff Louwerse
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.
October 6, 2015

I think that the problem you will find with that is that you still need two separate option lists since script-runner requires valid ID, VALUE pairs for that field. I don't think that there is any way around that if using the built in Select list.

1 vote
JamieA
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.
October 7, 2015

What I would have suggested is a custom listener that listens for com.atlassian.jira.event.issue.field.CustomFieldUpdatedEvent. If it's the right field, it syncs the options to the other field.

However, modifying the options doesn't fire that event, apparently. 

Generally we do this kind of thing through a script, that could update the options in both fields. As Jeff said, they can't be the same option.

Brent Webster
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.
October 7, 2015

Too bad, thanks for your reply.

TAGS
AUG Leaders

Atlassian Community Events