Delen via


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.

DELETE https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?api-version=4.1
DELETE https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/{id}?destroy={destroy}&api-version=4.1

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 '4.1' to use this version of the api.

destroy
query

boolean

Optional parameter, if set to true, the work item is deleted permanently

Responses

Name Type Description
200 OK

WorkItemDelete

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=4.1

Sample response

Definitions

Name Description
ReferenceLinks

The class to represent a collection of REST reference links.

WorkItem

Describes a work item.

WorkItemDelete

Full deleted work item object. Includes the work item itself.

WorkItemRelation

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

ReferenceLinks

Link references to related REST resources.

fields

object

Map of field and values for the work item.

id

integer

The work item ID.

relations

WorkItemRelation[]

Relations of the work item.

rev

integer

Revision number of the work item.

url

string

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

WorkItem

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.