Returns metadata for the specified entity type (Defects, Requirements and so on).
Use the operation to get information about the fields an entity's edit form can have and about all the values those fields can contain.
Authentication
Basic authentication using a user’s login and password. See Authentication for details.
Security Rights
The authenticating user must belong to a security group that has the Read privilege for the target entity (Defects, Tests and so on).
Request Format
To get the metadata, send a GET request to the following URL:
offset : integer, default: 0
The number of entity fields to skip before counting the returned fields. The default value is 0, which is the offset of the first field. For details, see Paging Through Results Using Offset and Limit.
limit : integer, default: 25
The maximum number of fields to return in the response.
EntityCode : string, required
The type of the item, whose metadata you want to get. Possible values:
-
Bugs (defects)
-
FunctionalSpecs (requirements)
-
Releases
-
TestCases (legacy test cases used in releases 9.6.0 and earlier)
-
TestConfigurations
-
Tests
-
TestSets
A sample request:
GET http://yourserver.com/rest-api/service/api/v1/projects/11873/metadata?EntityCode=Bugs HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
A sample request made by using cURL:
curl -u john@example.com:p@ssword -H "Accept: application/json" http://yourserver.com/service/api/v1/projects/11873/metadata?EntityCode=Bugs
Response Format
On success, the operation responds with HTTP status code 200 and returns an array of objects that describe the item metadata.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 429
{
"metadata": {
"result_set": {
"count": 25,
"offset": 0,
"limit": 25,
"total": 1016
},
"permissions": {
"acl": 1
}
},
"results": [
{
"name": "BugId",
"caption": "Id",
"field_type": "TextBoxNumeric",
"is_required": true
},
{
"name": "AssignedToName",
"caption": "Assigned To",
"field_type": "ComboBox",
"is_required": false,
"allowed_values": [
{
"key": "Smith, John",
"value": "Smith, John"
},
...
{
"key": "Doe, Jane",
"value": "Doe, Jane"
}
]
},
...
]
}
Metadata about the field list.
Pagination information about the field list. (See Paging Through Results Using Offset and Limit.)
The number of returned fields.
The offset of the first field requested.
The maximum number of fields requested.
The total number of fields.
The authenticating user’s rights to access the entity.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
An array of fields.
The name of the field.
The caption of the field as it appears in QAComplete.
The type of the field.
True if the the field is required. Otherwise, False.
For lookup fields (choice lists), an array of objects describing the values the field can take.
The value’s key.
The value the field can contain, as it appears in QAComplete.
Error responses
If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.
If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied
error.