Instances (Entities)

An instance (entity) is a single member of a collection, such as one defect or one application module.

Overview

The fields of the entity are as defined by the fields metadata REST API for an entity.

Each instance described in the REST API can be accessed directly by ID.

  • A resource instance represents an object on the server side.

  • A resource instance is identified by its unique ID in the relevant context.

  • An entity is a resource instance.

  • A resource instance is identified using the following syntax:

    <context>/<resource collection>/<resource instance id>

Back to top

URI

The following is an example of a URI of the containing collection with the ID of a defect instance appended:

.../api/shared_spaces/<space_id/workspaces/<workspace_id>/defects/2005

Back to top

Note: For the syntax for specifying parameters in URIs, see Variables and values.

Supported request methods

Instance resources support the following HTTP request methods.

Method

Description

Supports

GET

Retrieve the data

Read the entity

Supports: field selection

PUT

Update an existing entity

None

DELETE

Delete an existing entity

None

Back to top

Example

The following demonstrates a GET request for a defect resource instance, and the corresponding response.

GET request:

GET .../api/shared_spaces/<space_id>/workspaces/<workspace_id>/defects/1003

GET response:

{
    "type": "defect",
    "creation_time": "2014-01-27T13:01:52Z",
    "parent": {
        "type": "work_item_root",
        "id": ​"1002"
    },
    "logical_name": "1nq47mymd4o28sxkyeker7l86",
    "version_stamp": ​1,
    "release": {
        "type": "release",
        "id": ​"1002"
    },
    "description": "<html><body>\ndefect 1\n</body></html>",
    "id": ​"1003",
    "last_modified": "2016-01-27T13:01:52Z",
    "severity": {
        "type": "list_node",
        "id": ​"1073"
    },
    "phase": {
        "type": "phase",
        "id": ​"1015"
    },
    "priority": null,
    "name": "def1",
}

Back to top

Actions on instances

Back to top

See also: