From 0fdec03674b936e8ac2570a546b9f30fad145d61 Mon Sep 17 00:00:00 2001 From: Kevin Dutton Date: Tue, 17 Apr 2018 15:33:00 -0400 Subject: [PATCH] New sprint issue end point?! I was trying to use the `addIssueToSprint` function and kept getting 404's back from the JIRA API. After some digging, it looks like it's now located in the agile api with a few minor changes. I was able to successfully add an issue to a sprint this these updates. Heres the example from the updated docs: ``` curl --request POST \ --user email@example.com: \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data ' { "issues": [ "PR-1", "10001", "PR-3" ] }' \ --url 'https://your-domain.atlassian.net/rest/agile/1.0/sprint/{sprintId}/issue' ``` https://developer.atlassian.com/cloud/jira/software/rest/ Thanks! --- src/jira.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/jira.js b/src/jira.js index 7d78710a..8f4a5ca4 100644 --- a/src/jira.js +++ b/src/jira.js @@ -412,13 +412,12 @@ export default class JiraApi { * @param {string} sprintId - the id of the sprint to add it to */ addIssueToSprint(issueId, sprintId) { - return this.doRequest(this.makeRequestHeader(this.makeUri({ - pathname: `/sprint/${sprintId}/issues/add`, + return this.doRequest(this.makeRequestHeader(this.makeAgileUri({ + pathname: `/sprint/${sprintId}/issue`, }), { - method: 'PUT', - followAllRedirects: true, + method: 'POST', body: { - issueKeys: [issueId], + issues: [issueId], }, })); }