To add a new defect to your project in QAComplete, you call the …/project/{ProjectId}/defects (POST)
method.
Note: | You can create other items (tests and requirements) in a similar way by calling the appropriate operations. See /projects/{ProjectId}/requirements (POST) and /projects/{ProjectId}/tests (POST). |
Request
curl -u [email protected]:p@ssword -X POST -d @defect.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/defects
The defect.txt file describes the defect to be created:
{
"title": "Floating toolbar improvements",
"status": "New",
"description": "The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do."
}
Specify the Title
and Status
for the defect you want to create. The other fields of the defect are optional. If you do not specify any value in them, the server will set the default values.
Response
If the defect has been created successfully, the server returns information on it:
{
"id": 17,
"title": "Floating toolbar improvements",
"status": "New",
"__permissions": {
"acl": 7
},
"act_finish": "0001-01-01T00:00:00.0000000",
"act_hrs": 0,
"act_start": "0001-01-01T00:00:00.0000000",
"assignee_user_id": 0,
"closed_by": 0,
"custom_fields": [],
"date_closed": "0001-01-01T00:00:00.0000000",
"date_created": "2015-09-07T00:52:27.0700000",
"date_opened": "2015-09-07T00:52:27.0700000",
"date_resolved": "0001-01-01T00:00:00.0000000",
"date_updated": "2015-09-07T00:52:27.0700000",
"description": "The design of the floating toolbar needs improvement so that it’s clearer what the user needs to do.",
"est_finish": "0001-01-01T00:00:00.0000000",
"est_hrs": 0,
"est_hrs_remaining": 0,
"est_start": "0001-01-01T00:00:00.0000000",
"folder_id": 0,
"import_id": 0,
"nbr_events": 0,
"nbr_files": 0,
"nbr_notes": 0,
"nbr_tasks": 0,
"opened_by": 0,
"opened_by_company": "EDGB",
"opened_by_email": "[email protected]",
"opened_by_name": "Smith, John",
"original_id": 0,
"owner_name": "Smith, John",
"owner_user_id": 25264,
"pct_complete": 0,
"priority_code": " ",
"project_id": 11873,
"resolved_by": 0,
"severity_code": " ",
"update_user_id": 25264,
"user_name": "Smith, John"
}