node-jira-client
node-jira-client copied to clipboard
fix getIssueChangelog() wrong endpoint
calling the getChangelog() endpoint with an issueNumber causes the below error
null for uri: https://jira.[company-name].com/rest/api/2/issue/ISSUE-KEY/changelog?startAt=0&maxResults=50
This PR fixes the issue by doing the below
- add
expandproperty with value ofchangelogto the query object - remove
"/changelog"path as a suffix topathname(/issue/${issueNumber/)
This issue was also present in the dotnet implementation as well, which was fixed using this approach https://github.com/solidify/jira-azuredevops-migrator/issues/13
They look like two different endpoints:
- https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get
- https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-changelog-get
I am not familiar with Jira API, but I'd prefer to recommend getIssue(..., ..., "changelog") instead of turning getChangelog into an alias of getIssue