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){
Hi,
Try to use single select asynchronously https://aui.atlassian.com/aui/latest/docs/single-select.html, filter the results automatically when typing.
Thank you for the response,
but anyway because of the too many get REST API calls, the browser responds with
Failed to load resource: net::ERR_INSUFFICIENT_RESOURCES" error
url: AJS.contextPath() + `/rest/api/2/search?maxResults=1&startAt=${startAt}`,
type: "GET",
dataType : 'JSON',
success: function(response1){
I get some of the issues appended on the field, but at some the REST call fails due to thousand AJAX requests.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.