Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

maxResult of search REST API in "On demand JIRA"

srinivasan radhakrishnan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

HI,

I have faced the below problem,

The project have '3500' issues, i am using REST API to retrieved the first 1000 issues in project using 'maxResult=1000'

When i set the 'maxResult=1500' in REST API, it retrieved only 1000 issues. How can i retrieve more than 1000 record issues in "On demand JIRA" using REST API.

Please share the steps or REST API query?

Thanks.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Justin Alex Paramanandan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

The configuration to have more than 1000 results is easily configurable via backend configuration in a properties file (jira-config.properties file, to be exact)

In OnDemand (however), it's not possible to adjust this property and it's a best practice in OnDemand to do so (can cause security issues if used improperly). There is a way to go around this though; which is to query 1000 results per POST request (e.g: 3500 issues = 4 POSTS requests).

So, your initial would be like this:

{"jql": "project = PROJ ORDER BY key ASC","startAt":0,"maxResults":1000,"fields":["id","key","summary","status.id","issuetype","timeoriginalestimate","timeestimate"]}

And the second post would be:

{"jql": "project = PROJ ORDER BY key ASC","startAt":1001,"maxResults":499,"fields":["id","key","summary","status.id","issuetype","timeoriginalestimate","timeestimate"]}

The difference here is the startAt parameter, which controls the starting point of the search.

You can read more in this OnDemand KB: Changing maxResults Parameter for JIRA REST API

srinivasan radhakrishnan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

HI Justin Alex,

Thanks for replay. Please give the suggestion for below scenarios

1. If i not set the "maxResult" value in REST API, than How can i predict JQL query result count in REST API?

- In this scenario the JQL query actual have more 1000 results, but in "On demand JIRA" anything else it return maximum 1000 results.

Thanks.

Justin Alex Paramanandan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 16, 2013

Heya @srinivasan radhakrishnan,

If i not set the "maxResult" value in REST API, than How can i predict JQL query result count in REST API?

Indeed, it's hard to estimate how many results a particular JQL would return though. I believe that the best approach around this would be to gather the results, and notice how many has been returned. If it's 1000, then you can adjust the startAt and maxResults values accordingly to check for more results.

In this scenario the JQL query actual have more 1000 results, but in "On demand JIRA" anything else it return maximum 1000 results.

Have you tried to use the startAt and maxResults in OnDemand? I believe it should return the results if you use a separate POST REST call. I used the followiing in Atlassian's Bug Tracker:

{"jql": "project = JRA ORDER BY key ASC","startAt":0,"maxResults":1000,"fields":["id","key","summary"]}

This one returns me issues from JRA-1 to JRA-1185.

{"jql": "project = JRA ORDER BY key ASC","startAt":1001,"maxResults":2000,"fields":["id","key","summary"]}

This one returns JRA-1187 to JRA-2272.

I think it should work for OnDemand as well, since the REST API architecture is the same across JIRA instances.

Eric Salonen
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 3, 2014

To be precise (I actually couldnt find the information easily :D), this is what needs to be in your jira-application.properties file (if you have your own hosted JIRA):

##
# The maximum number of results to issue navigator will request from a query - set this to zero or negative to be unrestricted (note that the server may forbid this, see below)
#
jira.search.views.default.max = 0
# Limits the number of issues that may be edited via a bulk operation in one go. This may be useful if you are experiencing performance issues due to a large number of concurrent edits of
# large number of issues.  Please note that this should NOT be used to disable bulk edit operations.  Use the Global 'Bulk Change' permission accessible via the Admin interface in JIRA to
# do this. If a user tries to edit more than the provided number of issues here, an error will be displayed. Set the count to a negative number (-1) or simply comment out this property for
# unlimited number of issues.
jira.bulk.edit.limit.issue.count = -1
##
# Whether search results are capped to a hard limit, otherwise return a 403 (Forbidden) to the client.
#
# Set this to negative (-1) or empty for unlimited results.
#
# NOTE: this SHOULD BE EQUALS OR GREATER THAN than jira.search.views.default.max above, otherwise all issue navigator links will fail with a 403
#
jira.search.views.max.limit = -1

mthwaites May 16, 2015

Use maxResults=0 to get the full count first

Like Paul Stahlke likes this
0 votes
Ambientia Licenses July 3, 2014

As to be exact, this is wha tneeds to be in your jira-application.properties file (if you are not on OnDemand):

##
# The maximum number of results to issue navigator will request from a query - set this to zero or negative to be unrestricted (note that the server may forbid this, see below)
#
jira.search.views.default.max = 0
# Limits the number of issues that may be edited via a bulk operation in one go. This may be useful if you are experiencing performance issues due to a large number of concurrent edits of
# large number of issues. Please note that this should NOT be used to disable bulk edit operations. Use the Global 'Bulk Change' permission accessible via the Admin interface in JIRA to
# do this. If a user tries to edit more than the provided number of issues here, an error will be displayed. Set the count to a negative number (-1) or simply comment out this property for
# unlimited number of issues.
jira.bulk.edit.limit.issue.count = -1
##
# Whether search results are capped to a hard limit, otherwise return a 403 (Forbidden) to the client.
#
# Set this to negative (-1) or empty for unlimited results.
#
# NOTE: this SHOULD BE EQUALS OR GREATER THAN than jira.search.views.default.max above, otherwise all issue navigator links will fail with a 403
#
jira.search.views.max.limit = -1

Mei Ying Phuah August 27, 2017

hi~ can I have example of vba coding on how to exceed my maxResult which is only 50 issues per extraction. I want to extract my issues greater than 50 into excel worksheet 

TAGS
AUG Leaders

Atlassian Community Events