Common APIs
Log in
POST /OAuth/token
qTest version: 7+
Description: Authenticate the API client with qTest. and acquire the authorization token.
Request Authorization Header: It includes a username (any string representing your API client name) encoded following Basic Access Authentication protocol.
Password must not be filled in or the API will not work.
Request Body: You will need to include your qTest credentials in the request body with x-www-form-urlencoded content type.
Key | Required | Description |
---|---|---|
grant_type | yes | Always pass in "password" for this key. |
username | yes | Your qTest username |
password | yes | Your qTest password |
Request Sample:
POST /oauth/token
Host: nephele.qTestnet.com
Authorization: Basic bGluaC1sb2dpbjo=
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
--Request body starts from here
grant_type=password&username=---%40gmail.com&password=---
Response Body: token_type and access_token are included in the response. Use them in Authorization key when sending request APIs to qTest in the following format: [token_type] [access_token]
Response Sample:
{
"access_token": "---",
"token_type": "bearer",
"expires_in": 3599,
"scope": "read write create delete administration execute import export share baseline"
}
Revoke token (Log out)
POST /OAuth/revoke
Description: To revoke a token or terminate an active session.
Request sample:
POST /oauth/revoke
Host: qTest-dev.qTestnet.com
Authorization: bearer [token to be revoked]
Cache-Control: no-cache
Get Token Status
GET /OAuth/status
qTest version: 7+
Description: To check when the token expires if its session stays idle.
Request sample:
GET /oauth/status
Host: qTest-dev.qTestnet.com
Authorization: bearer [token]
Cache-Control: no-cache
Response body:
Key | Description |
---|---|
expiration | The time stamp at which the token will expires if its session keeps staying idle. If it is 0 (zero), the token will never expire. |
validityInMiliseconds | How long the token will be valid if its session stays idle. If it is 0, the token will never expire. |
Response sample:
{
"expiration": 1450169265371,
"validityInMilliseconds": 5231322
}
List all Projects
GET /api/v3/projects
qTest version: 4+
Description: To get the list of projects with ID that the requested account can access.
Request sample:
GET /api/v3/projects
Host: nephele.qTestnet.com
Authorization: bearer [token]
DVkMzQwYTdjZTU5NmU
Cache-Control: no-cache
Response sample:
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: application/json;charset=UTF-8
Date: Tue, 25 Mar 2014 02:59:25 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
[
{
"links": [
{
"rel": "self",
"href": "http://nephele.qTestnet.com/api/v3/projects/1"
},
{
"rel": "test-cases",
"href": "http://nephele.qTestnet.com/api/v3/projects/1/test-cases"
}
],
"id": 1,
"name": "qConnect - Sample Project",
"description": "qConnect is a professional network to connects you to your trusted contacts and helps you exchange knowledge, ideas, and opportunities with a broader network of professionals.",
"sample": true,
"status_id": 101,
"start_date": "12/10/2012",
"end_date": "12/10/2015",
"defect_tracking_systems": [
{
"url": "http://192.168.76.72:10614",
"active": false,
"id": 33,
"connection_name": "Jira connection",
"system_name": "Jira5"
},
{
"url": "http://192.168.76.72:10445",
"active": false,
"id": 38,
"connection_name": "Jira connection",
"system_name": "Jira4"
},
{
"url": "http://192.168.76.72:10606",
"active": false,
"id": 68,
"connection_name": "Jira connection",
"system_name": "Jira5"
},
{
"url": "http://192.168.25.45/",
"active": false,
"id": 133,
"connection_name": "FogBugz @ http://192.168.25.45/",
"system_name": "FogBugz"
},
{
"url": "http://192.168.45.39:8080",
"active": true,
"id": 134,
"connection_name": "Jira connection",
"system_name": "Jira4"
}
]
}
]
Get current user permission
GET /api/v3/projects/{projectId}/user-profiles/current
qTest version: 4+
Path variable:
-
projectId: ID of the project
Response body:
Property | Data Type | Description |
---|---|---|
user_id | long | |
project_id | long | |
module | JSON object | Contains Boolean properties: create/edit/delete/view |
requirement | JSON object | Contains Boolean properties: create/edit/delete/view/export/import |
test_case | JSON object | Contains Boolean properties: create/edit/delete/view/export/approve/import |
test_run | JSON object | Contains Boolean properties: create/edit/delete/view/execute/export |
defect | JSON object | Contains Boolean properties: create/edit/delete/view/export |
Request sample:
GET /api/v3/projects/1/user-profiles/current
Host: localhost:8082
Authorization: bearer [token]
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Response sample:
Cache-Control: no-cache
Content-Type: application/json;charset=UTF-8
Date: Thu, 10 Apr 2014 09:14:19 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
{
"user_id": 36,
"project_id": 1,
"module": {
"create": false,
"edit": false,
"delete": false,
"view": true
},
"requirement": {
"create": false,
"edit": false,
"delete": false,
"view": true,
"export": true,
"import": false
},
"test_case": {
"create": true,
"edit": true,
"delete": true,
"view": true,
"export": true,
"approve": true,
"import": false
},
"test_run": {
"create": true,
"edit": true,
"delete": true,
"view": true,
"execute": true,
"export": true
},
"defect": {
"create": true,
"edit": true,
"delete": false,
"view": true,
"export": true
}
}
Create A New Project
POST /api/v3/projects
qTest version: 4+
Description: To create a new project. The project's properties (name, description, start_date, end_date, and admins) are specified in the request body.
Request sample:
POST /api/v3/projects HTTP/1.1
Host: 192.168.74.69:8486
Authorization: bearer [token]
Content-Type: Application/json
Cache-Control: no-cache
{
"name": "Project created from API",
"description": "new project description",
"start_date": "2015-04-24T17:00:00Z",
"end_date": "2016-04-24T17:00:00Z",
"admins": ["admin@exampleemail.com"], "automation":true
}
Response sample:
{
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v3/projects/246"
}
],
"id": 246,
"name": "Project created from API",
"description": "new project description",
"start_date": "2015-04-24T17:00:00+00:00", "automation":true
}
User Invitation
POST /api/v3/users
qTest version: 4+
Description: To invite a user to qTest and activate the account. If the password is omitted, the default "admin123" will be used.
Request sample:
POST /api/v3/users HTTP/1.1
Host: 192.168.74.69:8487
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache
{
"username": "loicao7@yopmail.com",
"first_name": "First Name",
"last_name": "Last Name",
"email": "loicaoabc@yopmail.com",
"password": "loicao"
}
Response sample:
{
"links": [],
"username": "loicao7@yopmail.com",
"email": "loicaoabc@yopmail.com",
"password": "loicao",
"id": 54,
"first_name": "First Name",
"last_name": "Last Name"
}
Assign Users To A Project
POST /api/v3/users/projects
qTest version: 4+
Description: To assign a list of users to a project. The project ID and user IDs are specified in the request body.
POST /api/v3/users/projects HTTP/1.1
Host: localhost:8080
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache
{
"project_id": 1751,
"user_ids": [124]
}
Response sample:
{
"profile": {
"id": 2,
"name": "Developer"
},
"project_id": 1751,
"user_ids": [
124
]
}
Attach a file to Test Case, Test Log, Test Step
POST api/v3/projects/{projectId}/test-cases/{objectId}/attachments
POST api/v3/projects/{projectId}/test-steps/{objectId}/attachments
POST api/v3/projects/{projectId}/test-logs/{objectId}/attachments
qTest version: 4+
Description: To attach a file to an object.
Path variable:
-
projectId: ID of the project
-
objectId: ID of the object (test case, test step or test log)
Request sample:
POST /api/v3/projects/12833/test-cases/1016045/attachments HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Cache-Control: no-cache
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="file"; filename="QAS.xml"
Content-Type: text/xml
----WebKitFormBoundaryE19zNvXGzXaLvS5C
Response sample:
HTTP/1.1 201 CREATED
Cache-Control: no-cache
Content-Type: application/pdf
Date: Tue, 25 Mar 2014 04:29:52 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Server: Apache-Coyote/1.1
Transfer-Encoding: chunked
{
"links": [],
"name": "QAS.xml",
"id": 151244
}
Upload An Attachment
To a Release, Build, Requirement, Test Case, Test Log, Test Step, or Defect
POST /api/v3/projects/{projectId}/{objectType}/{objectId}/blob-handles
qTest version: 4+
Path variable:
-
projectId: ID of the project
-
objectType: it can be one of these types: releases, builds, requirements, test-cases, test-logs, test-steps or defects
-
objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)
Request body: the attachment content
Request sample:
POST /api/v3/projects/1/defects/1/blob-handles HTTP/1.1
Host: localhost:8080
Authorization: bearer [token]
Content-Type: application/jpeg
File-Name: testuploadfile.jpg
Cache-Control: no-cache
abcdasfsafsfsafsafsfQWEERqwefskjkloiopiojuhyewmxcncidjfskoqnayuhwlsoaskdfhsfasfwe
Response sample:
{
"links": [],
"name": "testuploadfile.jpg",
"id": 171
}
Download An Attachment
From a Release, Build, Requirement, Test Case, Test Log, Test Step or Defect
GET /api/v3/projects/{projectId}/{artifact-type}/{objectId}/attachments
qTest version: 6+
Path variable:
-
artifact-type: it can be release, build, requirements, test-cases, test-logs, test-steps, or defects
-
objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)
Request sample:
GET /api/v3/projects/1/test-cases/123/attachments
Host: localhost:8082
Authorization: bearer [token]
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Response sample:
[
{
"links": [
{
"rel": "self",
"href": "http://nephele.qTestdev.com/api/v3/projects/1/test-cases/23537/attachments/2556"
},
{
"rel": "author",
"href": "http://nephele.qTestdev.com/api/v3/users/588"
}
],
"name": "MUST READ.txt",
"content_type": "text/plain",
"id": 2556,
"web_url": "https://nephele.qTestdev.com/p/1/portal/attachment/testcase/attachmentId/2556",
"created_date": "2016-04-26T16:08:45+12:00",
"author": {
"id": 588,
"email": "bobsmith@email.com",
"first_name": "Bob",
"last_name": "Smith"
}
}
]
Then use the web_url to download the attachment.
Delete an Attachment
From a Release, Build, Requirement, Test Case, or Defect
DELETE /api/v3/projects/{projectId}/{artifact-type}/{objectId}/blob-handles/{blobhandleId}
qTest version: 7.5+
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be release, build, requirements, test-cases, test-logs, test-steps, or defects
-
objectId: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step or Defect)
-
blobhandleId: ID of the attachment
Request sample:
DELETE /api/v3/projects/1/requirements/2/blob-handles/3 HTTP/1.1
Host: nephele.qTestdev.com
Authorization: bearer [token]
Retrieve associated objects of given objects
GET /api/v3/projects/{projectId}/linked-artifacts?type={objectType}&ids={artifactId1,artifactId2}
qTest version: 7.5+
Path variable:
-
projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
---|---|---|
type | yes | It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects |
ids | yes | IDs of objects whose links you want to retrieve |
pids | yes | In case of type=defects, you can specify a list of external defect id in this parameters. It cannot be used for other types |
Request sample:
GET /api/v3/projects/1/linked-artifacts?type=defects&ids=40,41
Host: 192.168.74.105:8486
Authorization: bearer [token]
Response sample:
[
{
"id": 40,
"objects": [
{
"id": 214,
"pid": "TRUN-144",
"link_type": "is_associated_with",
"self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/214"
},
{
"id": 216,
"pid": "TRUN-146",
"link_type": "is_associated_with",
"self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/216"
}
]
},
{
"id": 41,
"objects": [
{
"id": 214,
"pid": "TRUN-144",
"link_type": "is_associated_with",
"self": "http://192.168.74.105:8486/tc/api/v3/projects/4/test-runs/214"
}
]
}
]
See below table for available link types between objects.
Artifact type | Link type | Associated artifact type |
---|---|---|
releases | Release scope includes | requirements |
builds | Build scope includes | requirements |
requirements | is covered by | test-cases |
requirements | is included in | releases |
requirements | is included in | builds |
test-cases | covers | requirements |
test-cases | is associated with | test-runs |
test-runs | is created from | test-cases |
test-runs | is associated with | defects |
defects | is associated with | test-runs |
defects | is associated with | test-logs |
defects | is associated with | test-steps |
test-logs | is associated with | defects |
test-steps | is associated with | defect |
Create A New Custom Field
POST /api/v3/projects/{projectId}/settings/releases/fields
POST /api/v3/projects/{projectId}/settings/builds/fields
POST /api/v3/projects/{projectId}/settings/requirements/fields
POST /api/v3/projects/{projectId}/settings/test-cases/fields
POST /api/v3/projects/{projectId}/settings/test-suites/fields
POST /api/v3/projects/{projectId}/settings/test-runs/fields
POST /api/v3/projects/{projectId}/settings/defects/fields
qTest version: 4+
Description: To create a new custom field for Release, Build, Requirement, Test Case, Test Suite, Test Run, Defect.
Path variable:
-
projectId: ID of the project
Request sample:
POST /api/v3/projects/1/settings/requirements/fields HTTP/1.1
Host: localhost:8080
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache
{ "label": "New Checkbox Field",
"required": true,
"searchable": true,
"free_text_search": true,
"search_key": "opp",
"data_type": 8,
"allowed_values":
[{"label": "Chrome",
"is_default": true,
"is_active": true},
{"label": "Firefox",
"is_active": true}]
}
Response sample:
{
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v3/projects/1/defects/fields/10786"
}
],
"id": 10786,
"label": "New Checkbox Field",
"required": true,
"constrained": true,
"order": 29,
"multiple": true,
"searchable": true,
"attribute_type": "ArrayNumber",
"allowed_values": [
{
"links": [],
"value": 1,
"label": "Chrome",
"order": 1,
"is_default": true,
"is_active": true
},
{
"links": [],
"value": 2,
"label": "Firefox",
"order": 2,
"is_default": false,
"is_active": true
}
],
"data_type": 8,
"free_text_search": true
}
Get all Comments
Of a Requirement, Test Case, Test Run or Defect
GET /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments
GET /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments
qTest version: 7.5+
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be requirements, test-cases, test-runs, or defects
-
PID or ID: the PID or ID of the object whose comments you want to retrieve
Request Parameter:
Parameter | Required | Description |
---|---|---|
size | no | The result is paginated. By the default, the number of test cases in each page is 100. You can specify your custom number in this parameter. The maximum page size is 1000 |
page | no | By default the first page is returned. However, you can specify any page number to retrieve test cases. |
Request sample:
GET /api/v3/projects/1/test-runs/1/comments/5 HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache
Response sample:
{
"links": [],
"page": 1,
"pageSize": 100,
"total": 2,
"items": [
{
"created": "2016-03-23T07:38:56+00:00",
"userId": 2,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/5"
},
{
"rel": "test-run",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
}
],
"id": 5,
"content": "this is a Test Run's comment"
},
{
"created": "2016-03-23T07:38:56+00:00",
"userId": 2,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/6"
},
{
"rel": "test-run",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
}
],
"id": 6,
"content": "this is another comment"
}
]
}
Get one Comment
Of a Requirement, Test Case, Test Run or Defect
GET /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}
GET /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}
qTest version: 7.5+
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be requirements, test-cases, test-runs, or defects
-
PID or ID: the PID or ID of the object whose comment you want to retrieve
-
commentId: ID of the comment which you want to retrieve
Request sample:
GET /api/v3/projects/1/test-runs/1/comments HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
Cache-Control: no-cache
Response sample:
{
"created": "2016-03-23T07:38:56+00:00",
"userId": 2,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/5"
},
{
"rel": "test-run",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
}
],
"id": 5,
"content": "This is a comment"
}
Add a Comment
To a Requirement, Test Case, Test Run or Defect
POST /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments
POST /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments
qTest version: 7.5+
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be requirements, test-cases, test-runs, or defects
-
PID or ID: the PID or ID of the object to which you want to post the comment
Request sample:
POST /api/v3/projects/1/test-runs/1/comments HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
{
"content": "This is a comment"
}
Response sample:
{
"created": "2016-04-20T04:34:14+00:00",
"userId": 2,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/51"
},
{
"rel": "test-run",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
}
],
"id": 51,
"content": "This is a comment"
}
Update a Comment
Of a Requirement, Test Case, Test Run or Defect
PUT /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}
PUT /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}
qTest version: 7.5+
Description: Author of a comment is able to update it
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be requirements, test-cases, test-runs, or defects
-
PID or ID: the PID or ID of the object whose comment you want to update
-
commentId: ID of the comment which you want to update
Request sample:
PUT /api/v3/projects/1/test-runs/1/comments/{29} HTTP/1.1
Authorization: bearer [token]
Content-Type: application/json
{
"content": "update a comment"
}
Response sample:
{
"created": "2016-03-25T10:46:01+00:00",
"updated": "2016-04-20T04:37:36+00:00",
"userId": 2,
"links": [
{
"rel": "self",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1/comments/29"
},
{
"rel": "test-run",
"href": "http://localhost:8080/test-conductor/api/v3/projects/1/test-runs/1"
}
],
"id": 29,
"content": "commented here for testrun change."
}
Delete a Comment
Of a Requirement, Test Case, Test Run or Defect
DELETE /api/v3/projects/{projectId}/{artifact-type}/{PID}/comments/{commentId}
DELETE /api/v3/projects/{projectId}/{artifact-type}/{ID}/comments/{commentId}
qTest version: 7.5+
Description: Author of a comment is able to delete it
Path variable:
-
projectId: ID of the project
-
artifact-type: it can be requirements, test-cases, test-runs, or defects
-
PID or ID: the PID or ID of the object whose comment you want to delete
-
commentId: ID of the comment which you want to delete
Request sample:
DELETE /api/v3/projects/1/test-runs/1/comments/{29} HTTP/1.1
Authorization: bearer [token]
Query objects
POST /api/v3/projects/{projectId}/search
qTest version: 7.6+
Description: This API mimics the Data Query function of qTest web app. It provides the capability to query Builds, Releases, Requirements, Test Cases, Test Cycles using created date and last modified date, Test Logs using execution time, Test Runs, Test Suites, and internal Defects.
Path variable:
-
projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
---|---|---|
pageSize | no | The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100. |
page | no | By default the first page is returned. However, you can specify any page number to retrieve objects. |
Request body:
Attribute Name | Required | Type | Description |
---|---|---|---|
object_type | yes | String | Its value can be requirements, test-cases, test-runs, or defects |
fields | no | String | Specify which object fields you want to include in the response. If you omit it or specify an asterisk (*), all fields are included. |
query | no | String | Specify a structured query to search for qTest objects. Basically, you can use the Query Summary text in qTest web app as in the below image for this attribute. |
-
If there are spaces in the criteria name, put it between ''
-
There need to be spaces between a criteria, operator and value
-
You can use field name, field Id or its search key in the query
-
You can use a value text or its Id in the query
-
For date time typed fields: you will need to convert the values to ISO Date Time format
-
Affected Release or Build: if you want to query Defects by their affected release, use Affected Release instead. Otherwise, use Affected Build
-
Target Release or Build: similarly, you will need to break it down to Target Release and Target Build
-
Fixed Release or Build: similarly, you will need to break it down to Fixed Release and Fixed Build
-
Subscriber: modify it to Subscribers and use user Id instead of user name to query
-
You will need to use object Id when querying using these fields: Id, Affected Release, Affected Build, Target Release, Target Build, Fixed Release and Fixed Build
-
Modify operator contains to ~, and modify operator not contains to !~. For example: instead of Name contains "login", change it to Name ~ "login"
-
Modify operator is not empty to is 'not empty'. For example: Name is 'not empty'
Request sample:
POST /api/v3/projects/5582/search HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Content-Type: application/json
{
"object_type": "requirements",
"fields": ["*"],
"query": "'id' = '262760'"
}
Response sample:
{
"links": [],
"page": 1,
"page_size": 100,
"total": 1,
"items": [
{
"links": [
{
"rel": "self",
"href": "http://nephele.qTestnet.com/api/v3/projects/5582/requirements/262760"
},
{
"rel": "module",
"href": "http://nephele.qTestnet.com/api/v3/projects/5582/modules/95539"
}
],
"id": 262760,
"name": "Install the app using adb",
"order": 28,
"pid": "REQS-1",
"properties": [
{
"field_id": 116609,
"field_value": "911"
},
{
"field_id": 116611,
"field_value": "901"
},
{
"field_id": 116610,
"field_value": "802"
},
{
"field_id": 116612,
"field_value": "[3754]"
},
{
"field_id": 116616,
"field_value": ""
}
],
"web_url": "https://nephele.qTestnet.com/p/5582/portal/project#tab=requirements&object=5&id=262760"
}
]
}
Query object history
POST /api/v3/projects/{projectId}/histories
qTest version: 7.6+
Description: To query history of Requirements, Test Cases, Test Runs and internal Defects
Path variable:
-
projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
---|---|---|
pageSize | no | The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100. |
page | no | By default the first page is returned. However, you can specify any page number to retrieve objects. |
Request body:
Attribute Name | Required | Type | Description |
---|---|---|---|
object_type | yes | String | Its value can be requirements, test-cases, test-runs, or defects. |
fields | no | String | Specify which object fields you want to include in the response. If you omit it or specify an asterisk (*), all fields are included. |
object_query | no | String | Specify a structured query to search for qTest objects. Refer to attribute query in the Request Body of Query objects. |
query | no | String | Specify a structured query to retrieve history of objects specified in attribute object_query above. Only these 2 criteria are supported:
You can use the operators "and" and "or" to combine an unlimited number of criteria above. |
Request sample:
POST /api/v3/projects/5582/histories HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Content-Type: application/json
{
"object_type": "requirements",
"fields": ["*"],
"object_query": "id = 2145792",
"query": "created > 2014-04-21T00:00:00+00:00 and author <> 588"
}
Response sample:
{
"links": [],
"page": 1,
"page_size": 100,
"total": 2,
"items": [
{
"created": "2016-04-28T15:29:49+07:00",
"links": [],
"id": 17068846,
"author_id": 18476,
"linked_object": {
"object_id": 2145792
},
"changes": [
{
"field": "Name",
"old_value": "Untitled",
"new_value": "REQ 4"
}
]
},
{
"created": "2016-04-28T15:29:43+07:00",
"links": [],
"id": 17068836,
"author_id": 18476,
"linked_object": {
"object_id": 2145792
},
"changes": [
{
"field": "Type",
"old_value": "",
"new_value": "Functional"
},
{
"field": "Name",
"old_value": "",
"new_value": "Untitled"
},
{
"field": "Priority",
"old_value": "",
"new_value": "Must have"
},
{
"field": "Status",
"old_value": "",
"new_value": "New"
}
]
}
]
}
Query Attachments
GET /api/v3/projects/{projectId}/attachments
qTest version: 7.6+
Description: To query attachments
Path variable:
-
projectId: ID of the project
Request Parameter:
Parameter | Required | Description |
---|---|---|
type | yes | It can be releases, builds, requirements, test-cases, test-steps, test-logs or defects |
ids | no | List of object ids, separated by commas |
author | no | Id of the user who created the attachment |
createdDate | no | Its format is: {operator} {date value encoded in ISO format} The operator can be one of the following values:
|
pageSize | no | The result is paginated. By the default, the number of objects in each page is 100. You can specify your custom number in this parameter. The maximum page size is 100. |
page | no | By default the first page is returned. However, you can specify any page number to retrieve objects. |
Request sample:
GET /api/v3/projects/5582/attachments?type=requirements&ids=262760&author=588&createdDate=lt%3A2017-04-21T00%3A00%3A00%2B00%3A00&page=1&pageSize=100 HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Response sample:
{
"links": [],
"page": 1,
"page_size": 100,
"total": 1,
"items": [
{
"links": [
{
"rel": "self",
"href": "http://nephele.qTestnet.com/api/v3/projects/5582/requirements/262760/attachments/44488"
}
],
"name": "Snap 2014-05-08 at 18.25.37.png",
"content_type": "image/png",
"id": 44488,
"web_url": "https://nephele.qTestnet.com/p/5582/portal/attachment/requirement/attachmentId/44488",
"artifact_id": 262760
}
]
}
Create Links Between Objects
POST /api/v3/projects/{projectId}/{objectType}/{objectId}/link?type={type}
qTest version: 7.6+
Description: to create links between objects
Path variable:
-
projectId: ID of the project
-
objectType: it can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects
-
objectId: Id of the source object to which you are adding the associated objects
Request Parameter:
Parameter | Required | Description |
---|---|---|
type | yes | It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects. It is the object type of the associated objects which are being added to the source object |
Request Body:
Request body includes an array which is a list of associated object ids separated by commas. Objects which are not the type specified in request parameter will not be added to the source object.
Request sample:
POST /api/v3/projects/5582/test-logs/2481734/link?type=defects HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Content-Type: application/json
[2145788, 2145790, 25086, 55121, 3321688, 3321684, 4318209,467126,467125, 3321700]
Response sample:
[
{
"id": 2481734,
"objects": [
{
"id": 467126,
"pid": "DFeCT-11",
"link_type": "is_associated_with",
"self": "http://nephele.qTestnet.com/api/v3/projects/5582/defects/467126"
},
{
"id": 467125,
"pid": "DFeCT-10",
"link_type": "is_associated_with",
"self": "http://nephele.qTestnet.com/api/v3/projects/5582/defects/467125"
}
]
}
]
Remove Links Between Objects
DELETE /api/v3/projects/{projectId}/{objectType}/{objectId}/link?type={type}
qTest version: 7.6+
Description: to remove links between objects
Path variable:
-
projectId: ID of the project
-
objectType: it can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects
-
objectId: Id of the source object from which you are removing the associated objects
Request Parameter:
Parameter | Required | Description |
---|---|---|
type | yes | It can be one of these types: releases, builds, requirements, test-cases, test-runs, test-logs, test-steps or defects. It is the object type of the associated objects which are being removed from the source object |
Request Body:
Request body includes an array which is a list of associated object ids separated by commas
Request sample:
DELETE /api/v3/projects/5582/test-logs/2481734/link?type=defects HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Content-Type: application/json
[2145788, 2145790, 25086, 55121, 3321688, 3321684, 4318209,467126,467125, 3321700]
Query Comments
POST /api/v3/projects/{projectId}/comments
qTest version: 7.6+
Description: to query comments
Path variable:
-
projectId: ID of the project
Request body:
Attribute Name | Required | Type | Description |
---|---|---|---|
object_type | yes | String | Its value can be requirements, test-cases, test-runs, defects |
object | no | String | Id of the object from which you want to retrieve comments |
authors | no | String | Id of the user who made the comments |
start | no | DateTime | This value need to be in ISO Date format |
end | no | DateTime | This value need to be in ISO Date format |
Request sample:
POST /api/v3/projects/5582/comments HTTP/1.1
Host: nephele.qTestnet.com
Authorization: bearer [token]
Content-Type: application/json
{
"object_type" : "requirements",
"object" : "262760",
"author" : "18476",
"start" : "2016-05-15T00:00:00+00:00",
"end" : "2016-05-22T00:00:00+00:00"
}
Response sample:
{
"links": [],
"page": 1,
"page_size": 100,
"total": 1,
"items": [
{
"created": "2016-05-17T21:25:18+07:00",
"userId": 18476,
"links": [
{
"rel": "self",
"href": "http://nephele.qTestnet.com/api/v3/projects/5582/requirements/262760/comments/387932"
},
{
"rel": "requirement",
"href": "http://nephele.qTestnet.com/api/v3/projects/5582/requirements/262760"
}
],
"id": 387932,
"content": "This is the comment's content"
}
]
}