Creates a single work item.
POST https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/${type}?api-version=7.1
With optional parameters:
POST https://dev.azure.com/{organization}/{project}/_apis/wit/workitems/${type}?validateOnly={validateOnly}&bypassRules={bypassRules}&suppressNotifications={suppressNotifications}&$expand={$expand}&api-version=7.1
URI Parameters Name In Required Type Description
organization
path Truestring
The name of the Azure DevOps organization.
project
path Truestring
Project ID or project name
type
path Truestring
The work item type of the work item to create
api-version
query Truestring
Version of the API to use. This should be set to '7.1' to use this version of the api.
$expand
queryThe expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }.
bypassRules
queryboolean
Do not enforce the work item type rules on this update
suppressNotifications
queryboolean
Do not fire any notifications for this change
validateOnly
queryboolean
Indicate if you only want to validate the changes without saving the work item
Request BodyMedia Types: "application/json-patch+json"
Name Type Description fromstring
The path to copy from for the Move/Copy operation.
opThe patch operation
pathstring
The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The "-" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-).
valueobject
The value for the operation. This is either a primitive or a JToken.
Responses Name Type Description 200 OKsuccessful operation
Security oauth2Type: 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
POST https://dev.azure.com/fabrikam/{project}/_apis/wit/workitems/${type}?api-version=7.1
[
{
"op": "add",
"path": "/fields/System.Title",
"from": null,
"value": "Sample task"
}
]
Sample response
{
"id": 131489,
"rev": 1,
"fields": {
"System.AreaPath": "CustomProcessPrj",
"System.TeamProject": "CustomProcessPrj",
"System.IterationPath": "CustomProcessPrj",
"System.WorkItemType": "Task",
"System.State": "New",
"System.Reason": "New",
"System.CreatedDate": "2017-10-06T01:04:51.57Z",
"System.CreatedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"System.ChangedDate": "2017-10-06T01:04:51.57Z",
"System.ChangedBy": {
"displayName": "Jamal Hartnett",
"url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"_links": {
"avatar": {
"href": "https://dev.azure.com/mseng/_apis/GraphProfile/MemberAvatars/aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
}
},
"id": "d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"uniqueName": "fabrikamfiber4@hotmail.com",
"imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d291b0c4-a05c-4ea6-8df1-4b41d5f39eff",
"descriptor": "aad.YTkzODFkODYtNTYxYS03ZDdiLWJjM2QtZDUzMjllMjM5OTAz"
},
"System.Title": "Sample task",
"Microsoft.VSTS.Common.StateChangeDate": "2017-10-06T01:04:51.57Z",
"Microsoft.VSTS.Common.Priority": 2
},
"_links": {
"self": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/131489"
},
"workItemUpdates": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/131489/updates"
},
"workItemRevisions": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/131489/revisions"
},
"workItemHistory": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/workItems/131489/history"
},
"html": {
"href": "https://dev.azure.com/fabrikam/web/wi.aspx?pcguid=20cda608-32f0-4e6e-9b7c-8def7b38d15a&id=131489"
},
"workItemType": {
"href": "https://dev.azure.com/fabrikam/aaee31d9-14cf-48b9-a92b-3f1446c13f80/_apis/wit/workItemTypes/Task"
},
"fields": {
"href": "https://dev.azure.com/fabrikam/_apis/wit/fields"
}
},
"url": "https://dev.azure.com/fabrikam/_apis/wit/workItems/131489"
}
Definitions JsonPatchDocument
Object
The JSON model for JSON Patch Operations
Name Type Description fromstring
The path to copy from for the Move/Copy operation.
opThe patch operation
pathstring
The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The "-" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-).
valueobject
The value for the operation. This is either a primitive or a JToken.
OperationEnumeration
The patch operation
Value Description add remove replace move copy test ReferenceLinksObject
The class to represent a collection of REST reference links.
Name Type Description linksobject
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.
WorkItemObject
Describes a work item.
Name Type Description _linksLink references to related REST resources.
commentVersionRefReference to a specific version of the comment added/edited/deleted in this revision.
fieldsobject
Map of field and values for the work item.
idinteger (int32)
The work item ID.
relationsRelations of the work item.
revinteger (int32)
Revision number of the work item.
urlstring
Object
Represents the reference to a specific version of a comment on a Work Item.
Name Type Description commentIdinteger (int32)
The id assigned to the comment.
createdInRevisioninteger (int32)
[Internal] The work item revision where this comment was originally added.
isDeletedboolean
[Internal] Specifies whether comment was deleted.
textstring
[Internal] The text of the comment.
urlstring
versioninteger (int32)
The version number.
WorkItemExpandEnumeration
The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }
Value Description noneDefault behavior.
relationsRelations work item expand.
fieldsFields work item expand.
linksLinks work item expand.
allExpands all.
WorkItemRelationObject
Name Type Description attributesobject
Collection of link attributes.
relstring
Relation type.
urlstring
Link url.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4