Skip to main content
Version: Early Access

Explore the attributes for an asset type

This article explains how to use the attributes of an asset type.

What

When I use the application user interface, I can see there are many fields on a Defect. When I work with the API, how do I know what all those fields are called?

How

Request the assets and attributes from the meta.v1 endpoint.

Getting Started

Have an HTTP Client. In this case, even a browser will suffice.

Start with what you see

In most cases, the name of the asset type is the same in the UI. However, the most commonly used asset types have different names depending on the methodology chosen during installation. The UI names can also be overridden by localization. The easiest thing to do is just try the name of an asset type in a meta.v1 query, then refer to the common mappings for asset types, if that doesn't work.

For the case of Defect, we can do the following.

<Server Base URI>/meta.v1/Defect?xsl=api.xsl

The result will resemble the following, except with many more attributes.

Defect derives from PrimaryWorkitem
* Name : Text
* Scope: Relation to Scope — reciprocal of Workitems
Description : LongText
Estimate : Numeric
Resolution : LongText
Status : Relation to StoryStatus — reciprocal of PrimaryWorkitems
Type : Relation to DefectType — reciprocal of Defects
VerifiedBy : Relation to Member — reciprocal of VerifiedDefects

Since we limited the query to just Defect the hyperlinks that render from applying the api.xsl will not be navigable. To get the whole set of assets and attributes, with links we can navigate, we can do the following.

<Server Base URI>/meta.v1?xsl=api.xsl

From here we can inspect attributes definitions by reading them. We can also navigate relationships by clicking on them.

sample-code