Dynamically add values to AUI Dropdown

Dhinnesh Jeevan May 18, 2017

Hi,

I would like to know, how can I generate the dropdown values dynamically using code, and not hard coding them? I have certain conditions, where depending on the condition, I will grab the values from the server, and populate them to the dropdown.

I was thinking of using Javascript to get the data from server, then format it to a JSON array, then assign it to the dropdown.

According to https://docs.atlassian.com/aui/latest/docs/dropdown.html, I can specify a source for the values, but in my case I have do perform some processing first before assigning the values to the dropdown.

How can I achieve this?

Thanks!

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 30, 2024

Hi @Dhinnesh Jeevan ,

my suggestion is to use Behaviour provided by Script Runner. In that way you can manage dropdown values based on specific conditions.

https://library.adaptavist.com/entity/basics-behaviours-set-multi-select-options-value

Hope this helps,

Fabio

Suggest an answer

Log in or Sign up to answer