Entity metadata reference

The ALM Octane public REST API is fully metadata-driven. All entities described by metadata resources can be accessed via the REST API as resource collection.

Entity metadata describe the features the entity supports. Here we describe how the features are represented in the REST API.

URI

Workspace level

http[s]://<server>:<port>/api/shared_spaces/<id>/workspaces/<id>/metadata/entities

Shared space level

http[s]://<server>:<port>/api/shared_spaces/<id>/metadata/entities

Site level

http[s]://<server>:<port>/admin/metadata/entities

Notes

Supported HTTP Methods

This API supports only the GET operation.

Properties

Entity Description
Name

The entity name for which the metadata is defined.

Field name: name

Features

Array of features supported by an entity.

Each item is a JSON object.

Field name: features

Description A description of the entity.
Label A label for the entity, typically displayed in the ALM Octane UI.

Back to top

Features

The table below describes the available features:

REST

REST API-related definitions

Field Description
name The name of the feature is a constant value: rest.
url The resource URL relative to the context root.
methods

An array of strings that the HTTP protocol methods supported. Values:

  • GET

  • POST

  • PUT

  • DELETE

Example: This example is for the workspaces entity (at the shared space level).

{
    "name": "rest",
    "url": "workspaces",
    "methods": [ "GET", "POST", "PUT" ]
}

Back to top

Mailing

Whether the entity supports mailing.

Fields Description
name

The name of the feature is a constant value: mailing.

Example: {
    “name”: “mailing”
    “url”: “mails”
}

Back to top

Drafts

Whether drafts of work items (epics, features, user stories, and defects) can be created.

Use drafts to bypass validation business rules when POSTing work items via the API. This allows integrations using the API to quickly create work items without, for example, validating required fields.

For details, see Working with draft entities.

Fields Description
name

The name of the feature is a constant value: draft_mode.

Example: {
    “name”: “draft_mode”
}

Back to top

Attachments

Whether the entity supports attachments by accessing the <context>/attachments API.

Fields Description
name

The name of the feature is a constant value: attachments.

To add an attachment to entities that support this feature, reference the entity in the <context>/attachments request using the field on the attachment entity:

owner_<entity name>

Where entity name can be the entity name or the parent entity name, if the entity has the subtype of attribute.

The actual field name can be queried via the field metadata API for the attachment entity. For details, see Field metadata reference.

Example: owner_defect

The attachment entity must have a reference to only one owner entity.

Example: {
{
    “name”: “attachments”
}

Back to top

Comments

Whether the entity supports comments by accessing the <context>/comments API.

Field Description
name

The name of the feature is a constant value: comments.

To add a comment to entities that support this feature, reference the entity in the <context>/comments request using the field on the comment entity:

owner_<entity name>

Where entity name can be the entity name or the parent entity name, if the entity has the subtype of attribute.

The actual field name can be queried via the field metadata API for the comment entity. For details, see Field metadata reference.

Example: owner_defect

The comment entity must have a reference to only one owner entity.

Example: {
    “name”: “comments”
    “relation_name”: “comments_to_epic”
}

Back to top

Business rules

Whether the entity supports business rules.

Fields Description
name

The name of the feature is a constant value: business_rules.

Example: {
    “name”: “business_rules”
}

Back to top

Subtypes

Defines that the entity has subtypes.

Aggregated entities have a field called subtype, which stores the subtype of the entity instance. Similarly, the subtype instances have a field called subtype of, which indicates the aggregated entity to which they are related.

Fields Description
name

The name of the feature is a constant value: subtypes.

types

A string array of the names of the entities, which are the subtypes of this entity.

Example: {
    “name”: “subtypes”,
    “types”: [
        “defect”,
        “feature”,
        “epic”,
        “work_item_root”,
        “story”
    ]
}

Back to top

Subtype of

Defines that an entity is a subtype of another entity.

Entities that are a "subtype of" have a field called subtype of, which indicates the aggregated entity to which they are related. Similarly, aggregated entities have a field called subtype, which stores the subtype of the entity instance.

Fields Description
name

The name of the feature is a constant value: subtype_of.

type

The name of the entity, which has this entity in the subtypes feature definition.

Example: {
    “name”: “subtype_of”,
    “type”: “work_item”
}

Back to top

Phases

The ability to advance the status of the entity from phase-to-phase using the defined workflow is supported.

Fields Description
name

The name of the feature is a constant value: phases.

Example: {
    “name”: “phases”
}

Back to top

Hierarchy

Defines whether the entity is hierarchical.

Fields Description
name

The name of the feature is a constant value: hierarchy.

root

The root entity in the hierarchy, with the following fields:

  • type. The type of the root entity—often, work_item_root.

  • id. The ID of the root entity.

    For non-empty arrays, multi-reference field by name children exists on the entity (this field will be defined in the fields metadata API).

    For non-empty arrays, reference field by name parents exists on the entity (this field will be defined in the fields metadata API).

  • child_types. An array of strings, the allowed types for child entities.

  • parent_types. An array of string, the allowed types for parent entities.

  • max_depth. The maximum number of levels allowed in the hierarchy.

Back to top

Defect entity example

The entities resource returns metadata about the data returned for a member of a collection. Below is an example of the metadata for the defect entity.

        {
            "features": [
                {
                    "parent_types": [
                        "feature",
                        "work_item_root"
                    ],
                    "max_depth": 4,
                    "root": {
                        "type": "work_item_root",
                        "id": "1001"
                    },
                    "name": "hierarchy",
                    "child_types": []
                },
                {
                    "methods": [
                        "DELETE",
                        "POST",
                        "GET",
                        "PUT"
                    ],
                    "name": "rest",
                    "url": "defects"
                },
                {
                    "name": "mailing",
                    "url": "mails"
                },
                {
                    "name": "attachments",
                    "relation_name": "attachments_to_defect"
                },
                {
                    "name": "phases"
                },
                {
                    "name": "subtype_of",
                    "type": "work_item"
                },
                {
                    "name": "user_defined_fields"
                },
                {
                    "name": "comments",
                    "relation_name": "comments_to_defect"
                },
                {
                    "name": "business_rules"
                }
            ],
            "name": "defect",
            "description": "A problem detected in the application.",
            "label": "Defect",
            "type": "entity_metadata"
        },

Back to top

See also: