This issue prevent users from retrieving plan(s) and using them as source to the Gadget
Summary
- Issue
- Steps to Reproduce
- Results
- Suggested Solution
- Workaround
1. Issue
Bamboo Plan Summary Chart gadget does not display above 1000 results under the "Select Plan" drop down.
2. Steps to Reproduce
- add the External Gadget described on this page into Confluence by visiting "Confluence administration >> General configuration >> External Gadgets >> Gadget Specification >> Gadget Specification URL"
http://localhost:8085/bamboo/rest/gadgets/1.0/g/com.atlassian.bamboo.gadgets:gadgets.charts.planSummaryChart/charts/planSummaryChart.xml
Please, refer to All Atlassian Gadgets documentation for further information
- go to a page in Confluence and add a macro to it, searching for "Bamboo Plan Summary Chart" macro
- attempt on searching for a plan
Please, find below the request call:curl 'http://localhost:8090/confluence/plugins/servlet/gadgets/makeRequest?refresh=3600&url=http%3A%2F%2Flocalhost%3A8085%2Frest%2Fapi%2Flatest%2Fplan.json%3Fexpand%3Dplans%26max-results%3D1000%26nocache%3D1449163383871&httpMethod=GET&headers=Accept%3Dapplication%252Fjson%252C%2520text%252Fjavascript%252C*%252F*%253Bq%253D0.01%26X-Atlassian-Token%3Dno-check&postData=&authz=&st=&contentType=JSON&numEntries=3&getSummaries=false&signOwner=true&signViewer=true&gadget=http%3A%2F%2Flocalhost%3A8085%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.bamboo.gadgets%2Fcharts%2FplanSummaryChart.xml&container=atlassian&bypassSpecCache=' -H 'X-Atlassian-Token: no-check' -H 'Accept-Encoding: gzip, deflate, sdch' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.73 Safari/537.36' -H 'Accept: */*' -H 'Referer: http://localhost:8090/confluence/plugins/servlet/gadgets/ifr?container=atlassian&mid=64427261952&country=GB&lang=en&view=default&view-params=%7B%22writable%22%3A%22true%22%7D&st=atlassian%3A3KHCf0V5Dmkra6y51BSbejGP4n0GRTXn3iQO1PD8rMG%2BXTCzZkqviCvvmM9DsCB2iZsLcArvf8GW9r4kiK4TdkyfWKO1y6RtkjMMIv95dG4cqpY2qbu0mSP3wnYuqgaTaEgpJOF7hax79rUL0bksaV9lqxFS2eLw2HOzoOX204L086zTrjv0ov2SkV56PJAafmG00XsDAzMXF%2BGZOChM2OTBirEhoqDS%2BxzHIP1ue0qXXJEqaDCM4VCB1h8RcsHevhPPhtFPkeAuZdP0h9fOkDr3soG5kAkFiDuNPvmTqLz%2BHd6U&up_plan=&up_groupByPeriod=AUTO&up_dateFilter=ALL&up_isConfigured=false&up_refresh=false&url=http%3A%2F%2Flocalhost%3A8085%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.bamboo.gadgets%2Fcharts%2FplanSummaryChart.xml&libs=auth-refresh' -H 'Cookie: JSESSIONID=DCA6D818A53234F1F8F758569527C887; atl.xsrf.token=7a1534a0e62f26cc8ecc404453e949f2ddba4475; bamboo.dash.display.toggles=buildQueueActions-actions-queueControl; mywork.tab.tasks=false; doc-sidebar=300px; JSESSIONID=C74678ADE41D4280D59089F2A9F6BB22' -H 'Connection: keep-alive' --compressedFrom the above we can notice its has been ran a Bamboo REST API call as per following:
curl -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8085/rest/api/latest/plan.json?expand=plans&max-results=1000
... args: [ { key: "plans", ajaxOptions: function () { return { url: "/rest/api/latest/plan.json", data: { "expand": "plans", "max-results": "1000", "nocache": Math.floor(new Date().getTime()) } }; } }, ] ...
3. Results
The following is a sample to what expect from Bamboo's REST API call:
# it only returns 1000 records maximum
{"expand":"plans","link":{"href":"http://localhost:8085/rest/api/latest/plan","rel":"self"},"plans":{"size":N,"expand":"plan","start-index":0,"max-result":1000,"plan":[{"shortName":"Plan","shortKey":"PLAN","type":"chain","enabled":true,"link":{"href":"http://localhost:8085/rest/api/latest/plan/PROJ-PLAN","rel":"self"},"key":"PROJ-PLAN","name":"Project - Plan","planKey":{"key":"PROJ-PLAN"}},...,{"shortName":"Plan","shortKey":"PLAN","type":"chain","enabled":true,"link":{"href":"http://localhost:8085/rest/api/latest/plan/PROJ-PLAN","rel":"self"},"key":"PROJ-PLAN","name":"Project - Plan","planKey":{"key":"PROJ-PLAN"}}]}}
4. Suggested Solution
Make the "Select plan" as an input field type, so if the plan typed cannot be found in the pre-populated "<options/>" then run a new REST API call (http://myhost.com:8085/bamboo/rest/api/latest/plan/{projectKey}-{buildKey} [GET]) against Bamboo searching for the particular plan not found in the drop down menu initially.
5. Workaround
No workaround available.