Hello everyone.
For my plugin development I need to implement a dropdown field with all the issues in a jira server.
I use a REST API call, firstly to get the total number of issues, and then I pull one by one issue and append them into the input field. I do this one by one, to get around the problem with 50 maxResults with one REST API request.
The execution of the script is slow, and sometimes the script don't get all the issues.
Can I optimize this REST API call, or maybe someone can help me with another kind of solution? Thank you
AJS.$.ajax({
url: AJS.contextPath() + "/rest/api/2/search",
type: "GET",
dataType : 'JSON',
success: function(response){
var totalNumber=response.total;
.......for(let i=0;i<totalNumber;i++){
AJS.$.ajax({
url: AJS.contextPath() + `/rest/api/2/search?maxResults=1&startAt=${startAt}`,
type: "GET",
dataType : 'JSON',
success: function(response1){