Skip to content

Latest commit

 

History

History
177 lines (151 loc) · 4.41 KB

azure-devops.rest

File metadata and controls

177 lines (151 loc) · 4.41 KB

@apiVersionParam = api-version=5.0 @apiVersionPreviewParam = api-version=5.1-preview.2

# Get current iteration # @name currentIteration GET {{baseUrl}}/work/teamsettings/iterations?$timeframe=current&{{apiVersionParam}} Authorization: Basic PAT {{token}}

### @iterationId = {{currentIteration.response.body.$.value[0].id}}

### Get iteration info GET {{baseUrl}}/work/teamsettings/iterations/{{iterationId}}?{{apiVersionParam}} Authorization: Basic PAT {{token}}

### Get iteration work items # User Story is an item with rel == null GET {{baseUrl}}/work/teamsettings/iterations/{{iterationId}}/workitems?{{apiVersionPreviewParam}} Authorization: Basic PAT {{token}}

### Get work item GET {{baseUrl}}/wit/workItems/1?$expand=Relations Authorization: Basic PAT {{token}}

### Get titles of User stories GET {{baseUrl}}/wit/workitems?ids=1&{{apiVersionParam}}&fields=System.Title,System.AreaPath,System.TeamProject,System.IterationPath Authorization: Basic PAT {{token}}

### Get titles of User stories GET {{baseUrl}}/wit/workitems?ids=1&{{apiVersionParam}}&$expand=Relations,Links Authorization: Basic PAT {{token}}

### Get tasks info GET {{baseUrl}}/wit/workitems?ids=66&{{apiVersionParam}} Authorization: Basic PAT {{token}}

### Get areas GET {{baseUrl}}/wit/classificationNodes/Areas?$depth=10&{{apiVersionParam}} Authorization: Basic PAT {{token}}

### Get tags GET {{baseUrl}}/wit/tags?api-version=6.0-preview.1 Authorization: Basic PAT {{token}}

### Get project info GET {{orgUrl}}/projects/Scrum?api-version=6.0 Authorization: Basic PAT {{token}}

### Get team members GET {{orgUrl}}/projects/Scrum/teams/Scrum%20Team/members Authorization: Basic PAT {{token}}

###

GET {{baseUrl}}/wit/workitemrelationtypes?{{apiVersionParam}} Authorization: Basic PAT {{token}}

### Get all possible values for Activity GET {{baseUrl}}/wit/workitemtypes/Task/fields/Microsoft.VSTS.Common.Activity?$expand=All&{{apiVersionParam}} Authorization: Basic PAT {{token}}

### # Microsoft.VSTS.Scheduling.RemainingWork # Microsoft.VSTS.Scheduling.OriginalEstimate

POST {{baseUrl}}/wit/workitems/$Task?{{apiVersionParam}} Authorization: Basic PAT {{token}} Content-Type: application/json-patch+json

[
{
"op": "add", "path": "/fields/System.Title", "value": "New sample task"

}, {

"op": "add", "path": "/fields/System.AreaPath", "value": "IDEAapp_2018"

}, {

"op": "add", "path": "/fields/System.TeamProject", "value": "IDEAapp_2018"

}, {

"op": "add", "path": "/fields/System.IterationPath", "value": "IDEAapp_2018\Iteration 1"

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Common.Activity", "value": "Development"

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Scheduling.RemainingWork", "value": 7

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Scheduling.OriginalEstimate", "value": 7

}, {

"op": "add", "path": "/relations/-", "value": {

"rel": "System.LinkTypes.Hierarchy-Reverse", "url": "https://dev.azure.com/ipatalas0593/_apis/wit/workItems/13"

}

}

]

# Add work item: https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/create?view=azure-devops-rest-5.0 # Add link https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.0#add_a_link

### Update task # https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/work%20items/update?view=azure-devops-rest-5.0 PATCH {{baseUrl}}/wit/workitems/66?{{apiVersionParam}} Authorization: Basic PAT {{token}} Content-Type: application/json-patch+json

[
{
"op": "add", "path": "/fields/System.Title", "value": "small task - edited"

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Common.Activity", "value": "Development"

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Scheduling.RemainingWork", "value": 2

}, {

"op": "add", "path": "/fields/Microsoft.VSTS.Scheduling.OriginalEstimate", "value": 2

}, {

"op": "add", "path": "/fields/System.AssignedTo", "value": "Ireneusz Patalas<[email protected]>"

},

{
"op": "add", "path": "/fields/System.Tags", "value": "Tag1; Tag2"

}

]

### Create User story

POST {{baseUrl}}/wit/workitems/$User%20Story?{{apiVersionParam}} Authorization: Basic PAT {{token}} Content-Type: application/json-patch+json

[
{
"op": "add", "path": "/fields/System.Title", "value": "test 2"

}, {

"op": "add", "path": "/fields/System.IterationPath", "value": "MyFirstProject\Iteration 1"

}

]