Update a resource

To update a resource, the resource with the corresponding ID and updated fields should be POSTed to the collection URL.

If a resource was updated successfully, the response will include resource represenation and has HTTP status 200.

πŸ“˜

You can control the results representation using resultFormat, resultInclude, resultExclude and resultAppend URL parameters.

POST /api/v1/UserStories?resultFormat=json&resultInclude=[Id,Name,Project] HTTP/1.1
Content-Type: application/json
 
{"Id":379, "Name":"CRUD operations"}
HTTP/1.1 200 OK
Content-Length: 113
Content-Type: application/json; charset=utf-8
 
{
  "Id": 379,
  "Name": "CRUD operations",
  "Project": {
    "Id": 378,
    "Name": "Some Project"
  }
}

Batch update entities within a single POST

It is possible to update several Targetprocess entities within single POST request sent to REST API.

For example, let's update two user stories with IDs #12 and #13 and set their status to Done (ID#5):

URL: /api/v1/userstories/bulk
Method: POST
Content-Type: application/json

[
	{
    "Id": 12,
		"EntityState":{"Id":5}
	},
	{
    "Id": 13,
		"EntityState":{"Id":5}
	}
]

Assign and Unassign actions

New assignments to entities (such as assignments of users and teams) are handled with POST calls. If there are existing assignments made already, they are appended and not replaced. In order to replace assignments with API call you have to unassign existing users or teams first. It is made within DELETE calls.