如何通过rest api从sprint中删除问题?
在此文档中,我仅找到将问题移至sprint的api https://docs.atlassian.com/jira-software/REST/7.3.1/#agile/1.0/sprint
找不到可从sprint消除问题的api
我在Google上搜索,通过这种方式http://jira:8080/rest/JIRA Agile / 1.0 / sprint / 1 / issues / remove by pust删除了,但这是行不通的!
我将邮递员的放置请求发送到此网址 http://10.22.0.170:8080/rest/agile/1.0/sprint/497/issues/remove
返回404,说找不到uri
<?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>
我想通过敏捷的REST API从sprint中删除问题
答案 0 :(得分:0)
您正在寻找的是:https://docs.atlassian.com/jira-software/REST/7.0.4/#agile/1.0/backlog-moveIssuesToBacklog
将问题移至待办事项列表。此操作等效于删除 给定问题的未来和积极冲刺。最多50 问题可能会立即转移。
Node.js示例
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));