Returns a filtered list of defects in the specified project.
Use the operation to get a filtered list of all defects registered in a QAComplete project. This operation is equivalent to the /projects/{ProjectId}/defects (GET) operation, but this one allows you to send a large filter string.
To get information on a specific defect by its ID, use the …/defects/{Id} (GET)
operation.
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 Defects.
Request Format
To get a filtered list of defects, send a POST request to the following URL:
URL parameters
ProjectId : integer, required
The ID of the project.
offset : integer, default: 0
The number of defects to skip before counting the returned defects. The default value is 0, which is the offset of the first item. For details, see Paging Through Results Using Offset and Limit.
limit : integer, default: 25
The maximum number of defects to return in the response.
Body parameters
In the request body, pass the RequestDefectsAllPostt
object that describes the defects to search for.
"Filter": "string"
}
Some string property values (for example, Status
) are based on choice lists defined in your QAComplete project. You can find these values in Defects > Show Defects > Actions > Manage Choice Lists in QAComplete.
Filter : string
The filter expression to apply to the returned list. See Search Filters.
A sample request:
POST http://yourserver.com/rest-api/service/api/v1/projects/11873/defects/search HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 63
{
"Filter": "(id in {1,2}) AND (title != 'Test Case 1')"
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d @requirements.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/defects/search
Response Format
If successful, the operation responds with HTTP status code 200 and returns a JSON object with defect information.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1871
{
"metadata": {
"result_set": {
"count": 1,
"offset": 0,
"limit": 25,
"total": 1
},
"permissions": {
"acl": 3
}
},
"results": [
{
"id": 2,
"title": "Floating toolbar improvements",
"status": "Active",
"__permissions": {
"acl": 3
},
"act_finish": "2015-06-31T00:00:00.0000000",
"act_hrs": 0,
"act_start": "2015-06-17T00:00:00.000000",
"actual_results": "The design of the floating toolbar is inconsistent.",
"assigned_to_name": "Smith, John",
"assignee_user_id": 27942,
"closed_by": 27942,
"custom_fields": [
{
"Id": "Custom1",
"Name": "Components",
"Value": "UI"
},
{
"Id": "Custom2",
"Name": "Fixed in build",
"Value": "1.0.13"
}
],
"date_closed": "0001-01-01T00:00:00.0000000",
"date_created": "2015-05-26T10:54:21.0930000",
"date_opened": "2015-05-27T11:42:29.1700000",
"date_resolved": "2015-06-24T09:55:25.4500000",
"date_updated": "2015-06-24T09:55:25.4500000",
"description": "The design of the floating toolbar needs improvement",
"est_finish": "0001-01-01T00:00:00.0000000",
"est_hrs": 0,
"est_hrs_remaining": 0,
"est_start": "0001-01-01T00:00:00.0000000",
"expected_results": "This should work",
"folder_id": 52359,
"folder_name": "UI Defects",
"functional_area_code": "",
"how_found_code": "Code Review",
"import_id": 0,
"issue_code": "Code Defect",
"nbr_events": 0,
"nbr_files": 1,
"nbr_notes": 1,
"nbr_tasks": 0,
"opened_by": 27942,
"opened_by_company": "EDGB",
"opened_by_email": "[email protected]",
"opened_by_name": "Smith, John",
"original_id": 0,
"owner_name": "Smith, John",
"owner_user_id": 27942,
"pct_complete": 0,
"priority_code": "1-Fix ASAP",
"project_id": 11873,
"resolution": "Toolbar is redesigned",
"resolution_code": "Fixed",
"resolved_by": 27942,
"resolved_by_name": "Smith, John",
"severity_code": "1-Crash",
"software_version_code": "1.0",
"steps_to_repro": "step 1\r\nstep 2\r\nstep 3\r\nstep 3.1\r\nstep 3.2\r\n",
"update_user_id": 27942,
"user_name": "Smith, John"
}
]
}
Metadata about the defect list.
Pagination information about the defect list. (See Paging Through Results Using Offset and Limit).
The number of returned defects.
The offset of the first defect requested.
The maximum number of defects requested.
The total number of defects.
The authenticating user’s access rights to defects.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
An array of defects.
The ID of the QAComplete project that contains the defects.
The actual date when the defect was fixed.
The actual hours spent fixing the defect.
The actual start date for defect fixing.
The actual outcome of actions performed when the defect was found. Can include an HTML markup.
The name of the user assigned to the defect, in the Lastname, Firstname format.
The ID of the user to whom the defect is assigned. 0 if the defect is not assigned to anyone.
The date and time when the defect was closed.
The ID of the user who closed the defect, or 0 if the defect is not closed.
The date and time when the record about the defect was created.
The date and time the defect was opened.
The date and time when the defect was resolved.
The date and time the defect was last updated.
The long description of the defect. Can include an HTML markup.
The estimated finish date for defect fixing.
The unique identifier of the defect.
The estimated hours to fix the defect.
The estimated remaining hours for defect fixing.
The estimated start date for working on the defect.
The expected results of the software if it did not have this defect. Can include an HTML markup.
The ID of the folder containing the defect.
The name of the folder containing the defect, in the ParentFolder/Subfolder/Subfolder format.
The functional area where the defect was found. This value is based on a choice list.
The ID of the user who created the defect.
The way the defect was found.
For importing: the import batch number.
The defect type based on a choice list.
The number of calendar events attached to the defect.
The company name of the user who created the defect.
The number of files attached to the defect.
The number of notes attached to the defect.
The number of tasks attached to the defect.
The email address of the user, who created the defect.
The name of the user who marked the defect as resolved, in the Lastname, Firstname format.
The ID of the user who last updated the defect.
The list of custom fields and their values.
For importing: to retain the original key that was imported.
The name of the user who created the defect, in the Lastname, Firstname format.
The name of the user who created the defect, in the Lastname, Firstname format.
The ID of the user, who owns the defect.
The percentage complete of defect fixing.
The defect priority.
The defect’s resolution status based on a choice list.
The defect’s resolution details. Can include an HTML markup.
The name of the user who resolved the defect, in the Lastname, Firstname format.
The defect severity.
The project version that the defect affects.
The steps to reproduce the defect. Can include an HTML markup.
The defect’s status.
The defect title (subject).
The name of the user who last updated the defect, in the Lastname, Firstname format.
The unique identifier of a custom field.
The field name.
The field value.
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.