Details
-
Bug
-
Resolution: Fixed
-
Low
-
8.20.0, 9.7.1
-
None
-
8.2
-
1
-
Severity 3 - Minor
-
Description
Issue Summary
When your instance contains over 99 dashboards, the /rest/api/2/dashboard?maxResults=1000&startAt=0 API endpoint fails to exhibit the complete dashboard collection.
This API endpoint omits one record for every 100 results, leading to an altered display:
- When querying for 100 dashboards, only 99 will be visible.
- Querying for 1000 dashboards results in only 990 being displayed.
Consequently, when dealing with a considerable number of dashboards, a fraction of them may not be retrievable.
This is reproducible on Data Center: yes
Steps to Reproduce
- Configure more than 1000 dashboards in your Jira environment.
- An example script that could be used for this:
#!/bin/bash # Set your JSESSIONID and atlassian.xsrf.token values here JSESSIONID="retrieve_from_browser_session" XSRF_TOKEN="retrieve_from_browser_session" x=1 while [ $x -le 3500 ] do dashboardName="Dashboard_$x" # Unique dashboard name curl 'http://jira.ub2.atl:8080/jira971/secure/AddPortalPage.jspa' \ -H "Cookie: JSESSIONID=$JSESSIONID; atlassian.xsrf.token=$XSRF_TOKEN" \ --data-raw "portalPageName=$dashboardName&portalPageDescription=&clonePageId=&favourite=true&projectShare=10000&roleShare=&shareValues=%5B%5D&atl_token=$XSRF_TOKEN&add_submit=Add" \ --compressed x=$((x+1)) done
- Don't use in production instances!
- An example script that could be used for this:
- Retrieve a list of dashboards using REST API endpoint: /rest/api/2/dashboard?maxResults=1000&startAt=0
- Store the results in a file, e.g dashboards.json
- Count the amount of records retrieved using grep.
grep -c "\"id\"" dashboards.json
Expected Results
1000 records will be retrieved.
Actual Results
Only 990 records are retrieved.
Workaround
Retrieve the dashboards from the database instead.
select * from portalpage;