Resources and collections


Entity represents Targetprocess objects such as User Story, Bug, Task, Project, Iteration etc. It contains Fields, Nested entities and Collections of Nested entities. Here is an example of simplified entity structure for User Story:



You can get various entities like User Stories, Bugs, Tasks, Iterations, Releases, Test Cases, etc. Check API Reference documentation for more details.

Entity always has an Id field.

<UserStory ResourceType="UserStory" Id="1667" Name="Create landing page for site">
  <!-- Fields -->
  <Description nil="true"/>
  <EndDate nil="true"/>
  <LastCommentDate nil="true"/>
  <PlannedStartDate nil="true"/>
  <PlannedEndDate nil="true"/>
    <!-- References to other resources -->
  <EntityType ResourceType="EntityType" Id="4" Name="UserStory"/>
  <Project ResourceType="Project" Id="1583" Name="dsfsdf">
    <Process ResourceType="Process" Id="3" Name="Scrum"/>
  <Owner ResourceType="GeneralUser" Id="1">
  <LastCommentedUser nil="true"/>
  <LinkedTestPlan nil="true"/>
  <Release nil="true"/>
  <Iteration nil="true"/>
  <TeamIteration nil="true"/>
  <Team nil="true"/>
  <Priority ResourceType="Priority" Id="5" Name="Nice To Have">
  <EntityState ResourceType="EntityState" Id="46" Name="Open">
  <ResponsibleTeam nil="true"/>
  <Feature nil="true"/>
  <!-- Collections -->
    <Task ResourceType="Task" Id="137130" Name="Design"/>
    <Task ResourceType="Task" Id="137132" Name="HTML coding"/>
    <Field Type="DropDown">
      <Value nil="true"/>

To retrieve a single Entity use format:


For example, to retrieve a Bug with Id = 84 send the following request:



Some of the Entities are organized into the following hierarchy:

  • General
    • Assignable
      • InboundAssignable
      • OutboundAssignable
      • Epic
      • Feature
      • UserStory
      • Task
      • Bug
      • TestPlan
      • TestPlanRun
      • Request
    • Project
    • Program
    • Release
    • Iteration
    • TeamIteration
    • Team
    • TestCase

So instead of working with a particular Entity Type, like User Story, we can work with an Assignable or General type instead. Working with the Assignable and General types are the same as with any other entity type:


Nested entity

When two entities are connected (e.g. User Story belongs to a Project, or User Story has Entity State), they are connected by ID.
It means that if you want to create a new User Story in Project, you need to know Project ID:

POST /api/v1/UserStories/
Content-Type: application/json
{"Name":"New Story", "Project":{"ID":2}}

The same rule is applied when you update an entity. For example, changing User Story State to Done will require knowing ID of this Entity State:

POST /api/v1/UserStories/123
Content-Type: application/json


Collection represents a set of Entities of the same type. It can be a list of User Stories, Bugs, Tasks or any other objects.

<UserStories Next="/api/v1/UserStories/?take=25&amp;skip=25">
 <UserStory Id="196" Name="Set Due Date">
 <!-- ... -->
 <UserStory Id="192" Name="Make Task Important">
 <!-- ... -->

To retrieve a collection of all Entities use format:


For example, this request retrieves all Bugs:



One page of entities by default contains only 25 elements.
Learn more about that at Paging section.

Inner Collections

You can retrieve inner collections for entity. For example, User Story contains a collection of Bugs. In this case you can retrieve them:



You cannot add item to an inner collection.

Let's say you want to add a new item to an inner collection of Bugs for User Story with ID #123. Since you cannot add a new Bug directly to the inner collection, you need to add it to just plain collection of Bugs instead and to connect this Comment to original User Story by ID.

POST /api/v1/Bugs
Content-Type: application/json
{"UserStory":{"Id":123}, "Name":"This is a new bug", "Project":{"Id":2}}

Sometimes the way of connection between entities can be via a base class. For example, Time or Comment can be connected not only with User Story, but also with Tasks, Bugs or other Entity Types.
For example, if we continue to work with User Story with ID #123 and this time we want to add a new Comment to it. Again we need to add it to the plain collection of Comments and to connect this Comment to original User Story by ID. But since Comments can be added to any General Entity, we'll put the User Story ID in the General ID field.

POST /api/v1/Comments
Content-Type: application/json
{"General":{"Id":123}, "Description":"This is a new comment"}