Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Cascading select with values from SQL database table

Mattias Kallvi
Contributor
May 27, 2019

I need some guidance how to set up a cascading select where the values are populated from a SQL table. I don't want do do an import, I know I have that possibility with Scriptrunner. 

I have the following parent/child fields, Activity and Sub-activity. There are about 80 activities and 100 sub-activities. In total I get about 2200 combinations. I could just create a cascading select but then I need to maintain the 2200 combinations :-(

So, now I'm thinking if it is possible to dynamically populate my fields from a SQL-table? Any suggestions where to start? Do I need a plugin? Any recommodations? Could it be done with scriptrunner? And as usual, performance is always an important issue. My users don't want to sit and wait looking at a spinner.

1 answer

0 votes
Tarun Sapra
Community Champion
May 27, 2019

Hello @Mattias Kallvi 

I have personally tried this for single select list and not cascading list.

Using script runner, here's the why to do it for single select list

https://scriptrunner.adaptavist.com/latest/jira/behaviours-conversions.html#_walkthrough_choose_from_a_database_table

For your requirement this is a specific paid plugin as well for fetching data in custom field from various datasources including DB

https://marketplace.atlassian.com/apps/23337/elements-connect-formerly-nfeed?hosting=server&tab=overview

Mattias Kallvi
Contributor
May 27, 2019

Hello @Tarun Sapra 

Thanks for your answer. I have looked at Elements Connect plugin before to display custom user properties from LDAP. Maybe it's time to pick it up again :-)

The scriptrunner-way, is there some way of trigger the SQL-query based on changes in the form? For example, when user chooses Activity 1, query SQL table for sub-activities to Activity 1. Could Behaviours be used? Any other suggestions?

Suggest an answer

Log in or Sign up to answer