Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,678
Community Members
 
Community Events
165
Community Groups

Get all issues in jira with REST API-plugin development

Edited

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){

 

1 answer

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.

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you