1
votes

How to remove issue from sprint by rest api ?

I only find the api to move issue to sprint in this docs https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/sprint

Not found api to remove issue from sprint

I search with google, get this way http://jira:8080/rest/JIRA Agile/1.0/sprint/1/issues/remove by pust,but It does'nt work!

https://confluence.atlassian.com/jirakb/how-to-add-and-remove-issue-to-from-sprint-via-rest-api-779158574.html

I send the put request by postman to this url http://10.22.0.170:8080/rest/agile/1.0/sprint/497/issues/remove

It return 404 say uri not found

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<status>
    <status-code>404</status-code>
    <message>null for uri: http://10.22.0.170:8080/rest/agile/1.0/sprint/497/issues/remove</message>
</status>

I want to remove issue from sprint by agile rest api

1
Encountered the same issue, probably it is better to report to JIRA via their own forum.N00b Pr0grammer

1 Answers

0
votes

This is what you're looking for: https://docs.atlassian.com/jira-software/REST/7.0.4/#agile/1.0/backlog-moveIssuesToBacklog

Move issues to the backlog. This operation is equivalent to remove future and active sprints from a given set of issues. At most 50 issues may be moved at once.

Node.js example

const fetch = require('node-fetch');

headers = {
  'Authorization': `Basic ${Buffer.from(
    'username:jira_api_token'
  ).toString('base64')}`,
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

const bodyData = `{
  "issues": [
    "YOURISSUE-810"
  ]
}`

fetch('https://your-domain.atlassian.net/rest/agile/1.0/backlog/issue', {
  method: 'POST',
  headers: headers,
  body: bodyData
})
  .then(response => {
    console.log(
      `Response: ${response.status} ${response.statusText}`
    );
    return response.text();
  })
  .then(text => console.log(text))
  .catch(err => console.error(err));