jira-node / node-jira-client

A Node.js wrapper for the Jira REST API
https://jira-node.github.io/
MIT License
450 stars 169 forks source link

fix getIssueChangelog() wrong endpoint #339

Open zombieleet opened 2 years ago

zombieleet commented 2 years ago

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

  1. add expand property with value of changelog to the query object
  2. remove "/changelog" path as a suffix to pathname (/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

pioug commented 2 years ago

They look like two different endpoints:

I am not familiar with Jira API, but I'd prefer to recommend getIssue(..., ..., "changelog") instead of turning getChangelog into an alias of getIssue