Description
Issue Summary
While using the Capabilities REST API endpoint, if we include expanding (expand=true) of referenced objects inline, it does not appear to work correctly for arrays of referenced objects as only the first referenced object in array is returned.
Steps to Reproduce
- Obtain User token from Jira Align User Profile (User Menu->Edit Profile->API Token).
- Use Linux/MacOS to run command below. Please be sure that "curl" and "jq" packages are installed.
- Execute cURL command and replace "<token>" with token string obtained in step 1
- curl -s -X GET "https://<Jira Align URL>/rest/align/api/2/Capabilities?id=<capability_id>&expand=true" -H "accept: /" -H 'Authorization: bearer <token>' | jq '.'
- Please check that "releaseIds" array consists of 5 elements. However, "releases" and "points" arrays expand only the 1st element from "releaseIds" array.
Expected Results
All the elements in the releases and points corresponding to the release ids are returned.
Actual Results
When there are more than 1 release (i.e “releaseIds” array consists of X elements), the “releases” and “points” arrays expand the only 1st element from “releaseIds” array.
- Issuing the GET call without expanding: https://<Jira_Align_URL>/rest/align/api/2/capabilities?id=<capability_id> we get
[ { "id": 2613, "title": "FXPCapability1", "createDate": "2021-10-04T09:37:58Z", "createdBy": "661802", "ownerId": "661802", "description": "FXPCapability1", "primaryProgramId": 422, [...] "lastUpdatedBy": "661802", "parentId": 2610, "targetCompletionDate": null, "startInitiationDate": null, "portfolioAskDate": null, "customerIds": [], "effortSwag": null, "isCanceled": 0, "hypothesis": null, "designStage": null, "prototype": null, "leanUxCanvas": null, "releaseIds": [ 286, 287 ], "additionalProgramIds": [], "affectedCountryIds": [], "points": [ { "releaseId": 286, "estimationSystem": "T-Shirt", "estimationValue": null }, { "releaseId": 287, "estimationSystem": "T-Shirt", "estimationValue": null } ], "externalKey": null, "externalId": null, "externalProject": null, "connectorId": null, "quadrant": null, "strategicHorizon": null, "self": "https://<Jira_Align_URL>/rest/align/api/2/capabilities/2613" } ]
- While issuing the same call with the expand=true option 'https://<Jira_Align_URL>/rest/align/api/2/capabilities?id=<capability_id>&expand=true'
we only get the first point and release output from the releases and points arrays :... "releaseIds": [ 286, 287 ], "releases": [ { "id": 286, "title": "FXPC1", "shortName": "FXPC1", "type": 1, "status": 1, "description": "FXP Increment for capability programs", "startDate": "2021-10-01T00:00:00Z", "endDate": "2021-12-01T00:00:00Z", "lastUpdatedBy": "661802", "testSuite": 1, "releaseNumber": "FXPC1", "portfolioId": 128, ... "divisionId": null, "self": "https://<Jira_Align_URL>/rest/align/api/2/releases/286" } ], ... "points": [ { "releaseId": 286, "estimationSystem": "T-Shirt", "estimationValue": null } ], ...
Workaround
Currently there is no known workaround for this behavior. A workaround will be added here when available