The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Fabio Racobaldo _Catworkx_
Community Champion
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

TAGS
AUG Leaders

Atlassian Community Events