Having trouble finding a solution to this specific issue and I'm really hoping for a resolution.
I am currently working on developing a Jira gadget where I have a configuration screen with two fields. The first one is a quickfind project picker that allows you to type and find projects, then click on the desired one.
The second field is for Components. Here, you can select the component of the project you want to filter by. However, as components vary for each project, the Component field is populated through an AJAX call specified in the gadget's "args" section within the "config" part.
The only setback is that this AJAX call is triggered only upon the initial loading of the gadget, before a project is selected. Therefore, the result always shows "Select A Project".
I am looking for a way to rerun this AJAX call when the selected project is changed.
Is this scenario achievable? Or are there alternative solutions available? I have attempted using timers to detect changes, but encountered issues, particularly regarding accessing/altering the Component dropdown field which resulted in the gadget failing to load.
Update: Below you'll find the Javascript code for the gadget. As visible, I have implemented a refreshComponents()
method in Javascript, capable of retrieving the Components based on a project ID. However, I'm struggling to associate this with the correct event. Also, I seem unable to directly modify any components on the page using jQuery or standard JS.
<div id="chart_div" style="overflow: auto;"></div>
<script type="text/javascript">
// JavaScript code goes here
</script>