Azure DevOps Rest API-无法创建新的迭代 [英] Azure DevOps Rest API - Unable To Create New Iteration
问题描述
按照以下说明尝试使用REST API通过POST为项目创建迭代:
Trying to use REST API to create iterations for a project using POST as per this:
但是我一直收到400条回复.
However I keep getting a 400 response.
奇怪的是,我在UI中添加了一个(迭代3)-当我请求结果时,它不包括新的.
Curiously I added one in the UI (Iteration 3) - and when I request the results it does not include the new one.
是否存在无法正常工作的问题,或者我做错了什么?
Is there an issue with this not really working properly or am I doing something wrong?
https://dev.azure.com/{organization}/{projectId}/{teamId}/_apis/work/teamsettings/iterations?api-version=5.0
{
count: 3,
value: [
{
id: "f95df712-1f2d-4685-86ea-b2e7dbad8353",
name: "Iteration 0",
path: "CMMI2\Iteration 0",
attributes: {
startDate: null,
finishDate: null,
timeFrame: "current"
},
url: "https://dev.azure.com/{organization}/{projectId}/{teamId}/_apis/work/teamsettings/iterations/f95df712-1f2d-4685-86ea-b2e7dbad8353"
},
{
id: "ec4f29f0-0b48-4a52-9b71-45e396654330",
name: "Iteration 1",
path: "CMMI2\Iteration 1",
attributes: {
startDate: null,
finishDate: null,
timeFrame: "future"
},
url: "https://dev.azure.com/{organization}/{projectId}/{teamId}/_apis/work/teamsettings/iterations/ec4f29f0-0b48-4a52-9b71-45e396654330"
},
{
id: "ab3d8626-c613-48ff-9378-f3b7ed109d77",
name: "Iteration 2",
path: "CMMI2\Iteration 2",
attributes: {
startDate: null,
finishDate: null,
timeFrame: "future"
},
url: "https://dev.azure.com/{organization}/{projectId}/{teamId}/_apis/work/teamsettings/iterations/ab3d8626-c613-48ff-9378-f3b7ed109d77"
}
]
}
推荐答案
要创建新的迭代,您必须使用其他URL.您可以在这里找到它们:
To create new iteration, you have to use another urls. You can find them here: Classification Nodes - Create Or Update. Sample of Create iteration:
请求正文
JSON
{
"name":最终迭代",
属性":{
{
"name": "Final Iteration",
"attributes": {
"startDate":"2014-10-27T00:00:00Z",
"startDate": "2014-10-27T00:00:00Z",
"finishDate":"2014-10-31T00:00:00Z"
"finishDate": "2014-10-31T00:00:00Z"
}
}
这篇关于Azure DevOps Rest API-无法创建新的迭代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!