Work Items - Delete
Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution.
DELETE https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=7.1-preview.3
DELETE https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?destroy={destroy}&api-version=7.1-preview.3
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
id
|
path | True |
integer int32 |
ID of the work item to be deleted |
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path |
string |
Project ID or project name |
|
api-version
|
query | True |
string |
Version of the API to use. This should be set to '7.1-preview.3' to use this version of the api. |
destroy
|
query |
boolean |
Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token 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
Scopes
Name | Description |
---|---|
vso.work_write | Grants the ability to read, create, and update work items and queries, update board metadata, read area and iterations paths other work item tracking related metadata, execute queries, and to receive notifications about work item events via service hooks. |
Examples
Sample Request
DELETE https://dev.azure.com/fabrikam/Fabrikam-Fiber-Git/_apis/wit/workitems/{id}?api-version=7.1-preview.3
Sample Response
Definitions
Name | Description |
---|---|
Reference |
The class to represent a collection of REST reference links. |
Work |
Describes a work item. |
Work |
Represents the reference to a specific version of a comment on a Work Item. |
Work |
Full deleted work item object. Includes the work item itself. |
Work |
ReferenceLinks
The class to represent a collection of REST reference links.
Name | Type | Description |
---|---|---|
links |
object |
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
WorkItem
Describes a work item.
Name | Type | Description |
---|---|---|
_links |
Link references to related REST resources. |
|
commentVersionRef |
Reference to a specific version of the comment added/edited/deleted in this revision. |
|
fields |
object |
Map of field and values for the work item. |
id |
integer |
The work item ID. |
relations |
Relations of the work item. |
|
rev |
integer |
Revision number of the work item. |
url |
string |
WorkItemCommentVersionRef
Represents the reference to a specific version of a comment on a Work Item.
Name | Type | Description |
---|---|---|
commentId |
integer |
The id assigned to the comment. |
createdInRevision |
integer |
[Internal] The work item revision where this comment was originally added. |
isDeleted |
boolean |
[Internal] Specifies whether comment was deleted. |
text |
string |
[Internal] The text of the comment. |
url |
string |
|
version |
integer |
The version number. |
WorkItemDelete
Full deleted work item object. Includes the work item itself.
Name | Type | Description |
---|---|---|
code |
integer |
The HTTP status code for work item operation in a batch request. |
deletedBy |
string |
The user who deleted the work item type. |
deletedDate |
string |
The work item deletion date. |
id |
integer |
Work item ID. |
message |
string |
The exception message for work item operation in a batch request. |
name |
string |
Name or title of the work item. |
project |
string |
Parent project of the deleted work item. |
resource |
The work item object that was deleted. |
|
type |
string |
Type of work item. |
url |
string |
REST API URL of the resource |
WorkItemRelation
Name | Type | Description |
---|---|---|
attributes |
object |
Collection of link attributes. |
rel |
string |
Relation type. |
url |
string |
Link url. |