Recyclebin - Restore Work Item
从回收站还原已删除的工作项。
PATCH https://dev.azure.com/{organization}/{project}/_apis/wit/recyclebin/{id}?api-version=7.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
id
|
path | True |
integer (int32) |
要还原的工作项的 ID |
organization
|
path | True |
string |
Azure DevOps 组织的名称。 |
project
|
path |
string |
项目 ID 或项目名称 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1”才能使用此版本的 API。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
isDeleted |
boolean |
设置一个值,该值指示是否删除此工作项。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
成功作 |
安全性
oauth2
类型:
oauth2
流向:
accessCode
授权 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
作用域
名称 | 说明 |
---|---|
vso.work_write | 授予读取、创建和更新工作项和查询、更新板元数据、读取区域和迭代路径、其他工作项跟踪相关元数据、执行查询以及通过服务挂钩接收有关工作项事件的通知的能力。 |
示例
Restore a work item
示例请求
PATCH https://dev.azure.com/{organization}/_apis/wit/recyclebin/403?api-version=7.1
{
"isDeleted": false
}
示例响应
{
"id": 403,
"code": 200,
"type": "Bug",
"name": "Test bug to be deleted and then restored",
"project": "Fabrikam-Fiber-Git",
"deletedDate": "1/11/2017 11:18:16 PM",
"deletedBy": "Jamal Hartnett <fabrikamfiber4@hotmail.com>",
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403",
"resource": {
"id": 403,
"rev": 3,
"fields": {
"System.AreaPath": "Fabrikam-Fiber-Git",
"System.TeamProject": "Fabrikam-Fiber-Git",
"System.IterationPath": "Fabrikam-Fiber-Git\\Release 1\\Sprint 2",
"System.WorkItemType": "Bug",
"System.State": "New",
"System.Reason": "New defect reported",
"System.CreatedDate": "2017-01-11T23:14:16.37Z",
"System.CreatedBy": "Jamal Hartnett <fabrikamfiber4@hotmail.com>",
"System.ChangedDate": "2017-01-11T23:18:16.03Z",
"System.ChangedBy": "Jamal Hartnett <fabrikamfiber4@hotmail.com>",
"System.Title": "Test bug to be deleted and then restored",
"System.BoardColumn": "New",
"System.BoardColumnDone": false,
"Microsoft.VSTS.Common.StateChangeDate": "2017-01-11T23:14:16.37Z",
"Microsoft.VSTS.Common.Priority": 2,
"Microsoft.VSTS.Common.Severity": "3 - Medium",
"WEF_6CB513B6E70E43499D9FC94E5BBFB784_Kanban.Column": "New",
"WEF_6CB513B6E70E43499D9FC94E5BBFB784_Kanban.Column.Done": false,
"Microsoft.VSTS.Common.ValueArea": "Business"
},
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403"
},
"workItemUpdates": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403/updates"
},
"workItemRevisions": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403/revisions"
},
"workItemHistory": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403/history"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/wi.aspx?pcguid=d81542e4-cdfa-4333-b082-1ae2d6c3ad16&id=403"
},
"workItemType": {
"href": "https://dev.azure.com/fabrikam/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/workItemTypes/Bug"
},
"fields": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/fields"
}
},
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/403"
}
}
定义
名称 | 说明 |
---|---|
Reference |
表示 REST 引用链接集合的类。 |
Work |
描述工作项。 |
Work |
表示对工作项的注释的特定版本的引用。 |
Work |
完全删除的工作项对象。 包括工作项本身。 |
Work |
描述已删除工作项的更新请求。 |
Work |
ReferenceLinks
表示 REST 引用链接集合的类。
名称 | 类型 | 说明 |
---|---|---|
links |
object |
链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读链接。 |
WorkItem
描述工作项。
名称 | 类型 | 说明 |
---|---|---|
_links |
链接对相关 REST 资源的引用。 |
|
commentVersionRef |
对此修订中添加/编辑/删除的特定批注版本的引用。 |
|
fields |
object |
工作项的字段和值映射。 |
id |
integer (int32) |
工作项 ID。 |
relations |
工作项的关系。 |
|
rev |
integer (int32) |
工作项的修订号。 |
url |
string |
WorkItemCommentVersionRef
表示对工作项的注释的特定版本的引用。
名称 | 类型 | 说明 |
---|---|---|
commentId |
integer (int32) |
分配给批注的 ID。 |
createdInRevision |
integer (int32) |
[内部]最初添加此注释的工作项修订。 |
isDeleted |
boolean |
[内部]指定是否删除注释。 |
text |
string |
[内部]注释的文本。 |
url |
string |
|
version |
integer (int32) |
版本号。 |
WorkItemDelete
完全删除的工作项对象。 包括工作项本身。
名称 | 类型 | 说明 |
---|---|---|
code |
integer (int32) |
批处理请求中工作项作的 HTTP 状态代码。 |
deletedBy |
string |
删除工作项类型的用户。 |
deletedDate |
string |
工作项删除日期。 |
id |
integer (int32) |
工作项 ID。 |
message |
string |
批处理请求中工作项作的异常消息。 |
name |
string |
工作项的名称或标题。 |
project |
string |
已删除工作项的父项目。 |
resource |
已删除的工作项对象。 |
|
type |
string |
工作项的类型。 |
url |
string |
资源的 REST API URL |
WorkItemDeleteUpdate
描述已删除工作项的更新请求。
名称 | 类型 | 说明 |
---|---|---|
isDeleted |
boolean |
设置一个值,该值指示是否删除此工作项。 |
WorkItemRelation
名称 | 类型 | 说明 |
---|---|---|
attributes |
object |
链接属性的集合。 |
rel |
string |
关系类型。 |
url |
string |
链接 URL。 |