Menu

Defect APIs

Get Defect Fields
Get A Defect By Its ID
Get Recently Updated Defects
Submit A Defect
Update A Defect

Get Defect Fields

GET /api/v3/projects/{projectId}/settings/defects/fields

qTest version: 4+

Description: To get all Defect's active fields, including system and custom fields.

  • projectId: ID of the project

Request sample:

GET /api/v3/projects/1922/settings/defects/fields HTTP/1.1  
Host: qas.qtestnet.com
Authorization: --
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

Response sample:

 [  
       {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20867"
            }
        ],
        "id": 20867,
        "attribute_type": "String",
        "label": "Summary",
        "required": true,
        "constrained": false,
        "order": 0,
        "multiple": false,
        "data_type": 1,
        "searchable": false,
        "free_text_search": true,
        "search_key": "sum",
        "system_field": true,
        "original_name": "Summary",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20999"
            }
        ],
        "id": 20999,
        "attribute_type": "LongText",
        "label": "Description",
        "required": true,
        "constrained": false,
        "order": 1,
        "multiple": false,
        "data_type": 2,
        "searchable": false,
        "free_text_search": true,
        "search_key": "des",
        "system_field": true,
        "original_name": "Description",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/21006"
            }
        ],
        "id": 21006,
        "attribute_type": "Number",
        "label": "Type",
        "required": true,
        "constrained": true,
        "order": 3,
        "allowed_values": [
            {
                "links": [],
                "value": 10401,
                "label": "Bug",
                "order": 1,
                "is_default": true,
                "is_active": true
            },
            {
                "links": [],
                "value": 10767,
                "label": "New Feature",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10402,
                "label": "Enhancement",
                "order": 3,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10403,
                "label": "Change Request",
                "order": 4,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10803,
                "label": "Sales Request",
                "order": 5,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10404,
                "label": "Other",
                "order": 6,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 3,
        "searchable": false,
        "free_text_search": false,
        "search_key": "type",
        "system_field": true,
        "original_name": "Type",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20870"
            }
        ],
        "id": 20870,
        "attribute_type": "Number",
        "label": "Module",
        "required": true,
        "constrained": true,
        "order": 4,
        "allowed_values": [
            {
                "links": [],
                "value": 2023,
                "label": "MD-2023 qTest",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 33174,
                "label": "MD-11561 Site Administration",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 33175,
                "label": "MD-11562 Test Plan",
                "order": 3,
                "is_default": false,
                "is_active": true
            },
        ],
        "multiple": false,
        "data_type": 3,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "Module",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20874"
            }
        ],
        "id": 20874,
        "attribute_type": "Number",
        "label": "Status",
        "required": true,
        "constrained": true,
        "order": 7,
        "allowed_values": [
            {
                "links": [],
                "value": 10001,
                "label": "New",
                "order": 1,
                "is_default": true,
                "is_active": true,
                "color": "#90ee90"
            },
            {
                "links": [],
                "value": 10002,
                "label": "Assigned",
                "order": 2,
                "is_default": false,
                "is_active": true,
                "color": "#f4a460"
            },
            {
                "links": [],
                "value": 10003,
                "label": "Resolved",
                "order": 3,
                "is_default": false,
                "is_active": true,
                "color": "#87cefa"
            },
            {
                "links": [],
                "value": 10004,
                "label": "Reopened",
                "order": 4,
                "is_default": false,
                "is_active": true,
                "color": "#f08080"
            },
            {
                "links": [],
                "value": 10005,
                "label": "Closed",
                "order": 5,
                "is_default": false,
                "is_active": true,
                "color": "#d3d3d3"
            },
            {
                "links": [],
                "value": 10006,
                "label": "Deferred",
                "order": 6,
                "is_default": false,
                "is_active": true,
                "color": "#ffe4b5"
            }
        ],
        "multiple": false,
        "data_type": 15,
        "searchable": false,
        "free_text_search": false,
        "search_key": "stat",
        "system_field": true,
        "original_name": "Status",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/21011"
            }
        ],
        "id": 21011,
        "attribute_type": "Date",
        "label": "Target Date",
        "required": false,
        "constrained": false,
        "order": 9,
        "multiple": false,
        "data_type": 4,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "Target Date",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/21002"
            }
        ],
        "id": 21002,
        "attribute_type": "String",
        "label": "Submitted Date",
        "required": false,
        "constrained": false,
        "order": 10,
        "multiple": false,
        "data_type": 9,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "SubmittedDateDefect",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20869"
            }
        ],
        "id": 20869,
        "attribute_type": "Number",
        "label": "Severity",
        "required": true,
        "constrained": true,
        "order": 12,
        "allowed_values": [
            {
                "links": [],
                "value": 10301,
                "label": "Cosmetic",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10302,
                "label": "Minor",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10303,
                "label": "Average",
                "order": 3,
                "is_default": true,
                "is_active": true
            },
            {
                "links": [],
                "value": 10304,
                "label": "Major",
                "order": 4,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10305,
                "label": "Fatal",
                "order": 5,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 3,
        "searchable": false,
        "free_text_search": false,
        "search_key": "svt",
        "system_field": true,
        "original_name": "Severity",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/136887"
            }
        ],
        "id": 136887,
        "attribute_type": "Url",
        "label": "Checklist",
        "required": false,
        "constrained": false,
        "order": 13,
        "multiple": false,
        "data_type": 12,
        "searchable": false,
        "free_text_search": false,
        "default_value": "",
        "system_field": false,
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/136888"
            }
        ],
        "id": 136888,
        "attribute_type": "String",
        "label": "Branch",
        "required": false,
        "constrained": false,
        "order": 17,
        "multiple": false,
        "data_type": 1,
        "searchable": false,
        "free_text_search": false,
        "default_value": "",
        "system_field": false,
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20871"
            }
        ],
        "id": 20871,
        "attribute_type": "Number",
        "label": "Priority",
        "required": true,
        "constrained": true,
        "order": 18,
        "allowed_values": [
            {
                "links": [],
                "value": 10201,
                "label": "Undecided",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10202,
                "label": "Low",
                "order": 2,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10203,
                "label": "Medium",
                "order": 3,
                "is_default": true,
                "is_active": true
            },
            {
                "links": [],
                "value": 10204,
                "label": "High",
                "order": 4,
                "is_default": false,
                "is_active": true
            },
            {
                "links": [],
                "value": 10205,
                "label": "Urgent",
                "order": 5,
                "is_default": false,
                "is_active": true
            }
        ],
        "multiple": false,
        "data_type": 3,
        "searchable": false,
        "free_text_search": false,
        "search_key": "prt",
        "system_field": true,
        "original_name": "Priority",
        "is_active": true
    },
    {
        "links": [
            {
                "rel": "self",
                "href": "https://qas.qtestnet.com/api/v3/projects/1922/20873"
            }
        ],
        "id": 20873,
        "attribute_type": "Number",
        "label": "Assigned To",
        "required": true,
        "constrained": true,
        "order": 22,
        "allowed_values": [
            {
                "links": [],
                "value": 3087,
                "label": "Triet Ho",
                "order": -37,
                "is_default": false,
                "is_active": false
            },
            {
                "links": [],
                "value": 3842,
                "label": "Ngoc Tran",
                "order": -34,
                "is_default": false,
                "is_active": false
            },
            {
                "links": [],
                "value": 47,
                "label": "Long Do",
                "order": -33,
                "is_default": false,
                "is_active": false
            },
            {
                "links": [],
                "value": 7085,
                "label": "Duong Ngo",
                "order": -32,
                "is_default": false,
                "is_active": false
            },
            {
                "links": [],
                "value": 5542,
                "label": "thongmgnguyen@kms-techonology.com",
                "order": -30,
                "is_default": false,
                "is_active": false
            },
            {
                "links": [],
                "value": 2762,
                "label": "Anh Nguyen",
                "order": 1,
                "is_default": false,
                "is_active": true
            },
        ],
        "multiple": false,
        "data_type": 5,
        "searchable": false,
        "free_text_search": false,
        "system_field": true,
        "original_name": "Assigned To",
        "is_active": true
    },    
]

Get A Defect By Its ID

GET /api/v3/projects/{projectId}/defects/{defectId}

qTest version: 6+

Description: To retrieve a defect using its ID

Path variable:

  • projectId: ID of the project
  • defectId: ID of the defect which you need to retrieve

Request sample:

GET /api/v3/projects/1/defects/292105 HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

Response sample:

{
  "links": [
    {
      "rel": "self",
      "href": "https://nephele.qtestnet.com/api/v3/projects/1/defects/292105"
    }
  ],
  "properties": [
    {
      "field_id": 529108,
      "field_value": "The event link is not activated"
    },
    {
      "field_id": 529111,
      "field_value": "URL: http://www.qConnect.com \n\nAccount: maxmccloud@qasymphony.com/password\n\n\nStep:\n\n1) Launch the site\n\n2) The link Create an Event is not active"
    },
    {
      "field_id": 529109,
      "field_value": "5500"
    },
    {
      "field_id": 529118,
      "field_value": "-56401"
    },
    {
      "field_id": 529113,
      "field_value": "10304"
    },
    {
      "field_id": 529119
    },
    {
      "field_id": 529112,
      "field_value": "2015-01-11T13:03:37+00:00"
    },
    {
      "field_id": 529115,
      "field_value": "10204"
    },
    {
      "field_id": 529120,
      "field_value": "10613"
    },
    {
      "field_id": 529114,
      "field_value": "251171"
    },
    {
      "field_id": 529110,
      "field_value": "5202"
    },
    {
      "field_id": 529121,
      "field_value": "10006"
    },
    {
      "field_id": 529122,
      "field_value": "10402"
    },
    {
      "field_id": 529123
    },
    {
      "field_id": 529124,
      "field_value": "10107"
    },
    {
      "field_id": 529125,
      "field_value": "10510"
    },
    {
      "field_id": 529126,
      "field_value": "2015-07-29T17:00:00+00:00"
    },
    {
      "field_id": 529127,
      "field_value": "2015-07-30T03:56:00+00:00"
    },
    {
      "field_id": 529128
    },
    {
      "field_id": 568736
    },
    {
      "field_id": 583780
    }
  ],
  "id": 292105,
  "pid": "DF-48579",
  "submitted_date": "2015-01-11T03:03:37-10:00",
  "last_modified_date": "2015-07-29T18:57:03-09:00",
  "submitter_id": 5500,
  "last_modified_user_id": 5500,
  "web_url": "https://nephele.qtestnet.com/p/1/portal/project#tab=defects&object=17&id=292105"
}

Get Recently Updated Defects

GET /api/v3/projects/{projectId}/defects/last-change

qTest version: 6+

Description: To retrieve recently-updated defects, you can enter a specific time in the request parameter. The API will returns all defects which have been updated from the configured time.

Path variable:

  • projectId: ID of the project

Request Parameter:

Parameter Required Description
startTime yes The returned defects have been updated from this configured time. This value need to be URL encoded.
size no The result is paginated. By the default, the number of test cases in each page is 20. You can specify your custom number in this parameter.
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/defects/last-change?startTime=2015-07-28T10%3A04%3A00.000%2B07%3A00&start=1&pageSize=2 HTTP/1.1
Host: nephele.qtestnet.com
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

Response sample:

[
  {
    "links": [
      {
        "rel": "self",
        "href": "https://nephele.qtestnet.com/api/v3/projects/1/defects/292105"
      }
    ],
    "properties": [
      {
        "field_id": 529108,
        "field_value": "The event link is not activated"
      },
      {
        "field_id": 529111,
        "field_value": "URL: http://www.qConnect.com \n\nAccount: maxmccloud@qasymphony.com/password\n\n\nStep:\n\n1) Launch the site\n\n2) The link Create an Event is not active"
      },
      {
        "field_id": 529109,
        "field_value": "5500"
      },
      {
        "field_id": 529118,
        "field_value": "-56401"
      },
      {
        "field_id": 529113,
        "field_value": "10304"
      },
      {
        "field_id": 529119
      },
      {
        "field_id": 529112,
        "field_value": "2015-01-11T13:03:37+00:00"
      },
      {
        "field_id": 529115,
        "field_value": "10204"
      },
      {
        "field_id": 529120,
        "field_value": "10613"
      },
      {
        "field_id": 529114,
        "field_value": "251171"
      },
      {
        "field_id": 529110,
        "field_value": "5202"
      },
      {
        "field_id": 529121,
        "field_value": "10006"
      },
      {
        "field_id": 529122,
        "field_value": "10402"
      },
      {
        "field_id": 529123
      },
      {
        "field_id": 529124,
        "field_value": "10107"
      },
      {
        "field_id": 529125,
        "field_value": "10510"
      },
      {
        "field_id": 529126,
        "field_value": "2015-07-29T17:00:00+00:00"
      },
      {
        "field_id": 529127,
        "field_value": "2015-07-30T03:56:00+00:00"
      },
      {
        "field_id": 529128
      },
      {
        "field_id": 568736
      },
      {
        "field_id": 583780
      }
    ],
    "id": 292105,
    "pid": "DF-48579",
    "submitted_date": "2015-01-11T03:03:37-10:00",
    "last_modified_date": "2015-07-29T18:57:03-09:00",
    "submitter_id": 5500,
    "last_modified_user_id": 5500,
    "web_url": "https://nephele.qtestnet.com/p/1/portal/project#tab=defects&object=17&id=292105"
  }
]

Submit a Defect

POST /api/v3/projects/{projectId}/defects

qTest version: 4+

Description: To submit a Defect into qTest.

Request body:

Attribute Name Required Type Description
properties true JSON Array  
attachments false JSON Array  

Request sample:

 {  
  "properties":[  
   {  
    "field_id":93,  
    "field_value": "defect summary from Rest API"  
       },  
       {  
    "field_id":94,  
    "field_value": "defect description"  
   }]  
 }  

Response sample:

 {  
   "links": [],  
   "id": 10,  
   “pid”: “DF-10”,  
   “url”: “http://nephele.qtestnet.com/p/1/portal/project#tab=defects&object=17&id=1141”  
 }  

Update A Defect

PUT /api/v3/projects/{projectId}/defects/{defectId}

qTest version: 6+

Description: To update a defect

Path variable:

  • projectId: ID of the project
  • defectId: ID of the defect which needs to be updated

Request sample:

Update defect:
PUT /api/v3/projects/13/defects/47 HTTP/1.1
Host: 192.168.74.69:8486
Content-Type: application/json
Authorization: --
Cache-Control: no-cache

{
  "properties": [
    {
      "field_id": 753,
      "field_value": "DEFECT 1111111111"
    },
    {
      "field_id": 756,
      "field_value": "defect 12222222222222222"
    },
    {
      "field_id": 763,
      "field_value": "13"
    },
    {
      "field_id": 764,
      "field_value": "14"
    },
    {
      "field_id": 768,
      "field_value": "13"
    },
    {
      "field_id": 787,
      "field_value": "123"
    }
  ]
}
Subscribe To Our Blog
Powered by Zendesk