Adds a new requirement to QAComplete.
Use the operation to register a new requirement in your project in QAComplete.
To replace the entire requirement (to redefine all the field values), use the …/requirements/{Id} (PUT)
operation. To update individual fields, use the …/requirements/{Id} (PATCH)
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 Add privilege for Requirements.
Request Format
To create a requirement, send a POST request to the following URL:
URL parameters
ProjectId : integer, required
The ID of the project to which you want to add a requirement.
Body parameters
In the request body, pass the RequestRequirementPost
object that describes the requirement to create.
"Title": "string",
"Status": "string",
"Active": "boolean",
"ActFinish": "Date",
"ActHrs": "double",
"ActStart": "Date",
"BusinessRule": "string",
"Comments": "string",
"CustomFields": [
{
"Id": "string",
"Name": "string",
"Value": "string"
}
],
"Description": "string",
"EstFinish": "Date",
"EstHrs": "double",
"EstHrsRemaining": "double",
"EstStart": "Date",
"FolderId": "int",
"Grouping": "string",
"Keywords": "string",
"OriginalId": "int",
"OwnerUserId": "int",
"PctComplete": "int",
"SubGrouping": "string"
}
Some string property values (for example, Status
) are based on the choice lists defined in your QAComplete project. You can find these values in the Requirements > Show Requirements > Actions > Manage Choice Lists panel in QAComplete.
Title : string (max 255 chars), required
The requirement title (name). Cannot be empty.
Status : string (max 100 chars), required
The requirement status based on a choice list. Cannot be empty.
Active : boolean
Specifies whether the requirement is enabled (active).
ActFinish : dateTime
The actual date when the requirement was completed.
ActHrs : double
Actual hours spent working on the requirement. Default: 0.
ActStart : dateTime
Actual start date for working on the requirement.
BusinessRule : string
Business rule associated with the requirement. Can include HTML markup. Default value: empty string.
Comments : string
Comments to the requirement. Can include HTML markup. Default value: empty string.
CustomFields : array of objects
An array of CustomFields
objects that describe custom fields and their values:
{
"Id": "string",
"Name": "string",
"Value": "string"
}
Id : string, required
The unique identifier of the custom field. Must be in the CustomN
format, where N
is the custom field’s number (index).
Name : string
The field name.
Value : string
The field value.
Description : string (max 65000 chars)
Long description of the requirement. Can include HTML markup. Default value: empty string.
EstFinish : dateTime
The estimate date of the finishing the requirement.
EstHrs : double
Estimated hours to finish the requirement. Default: 0.
EstHrsRemaining : double
Estimated remaining hours for finishing the requirement. Default: 0.
EstStart : dateTime
Estimated start date for working on the requirement.
FolderId : integer
The ID of the folder containing the requirement, or 0 if the requirement not in any folder.
Grouping : string
The group that contains the requirement.
Keywords : string
Keywords of the requirement.
OriginalId : integer
For importing: to retain the original key that was imported. Default: 0.
OwnerUserId : integer
The ID of the user who owns the requirement. Default value: the ID of the current user.
PctComplete : integer
Percentage complete of requirement completing. Default: 0.
SubGrouping : string
The sub group that contains the requirement.
A sample request:
POST http://yourserver.com/rest-api/service/api/v1/projects/11873/requirements HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 68
{
"Title": "Add Visual Studio integration",
"Status": "Active"
}
A sample request made by using cURL:
curl -u [email protected]:p@ssword -d {"Title": "Add Visual Studio integration", "Status": "Active"} -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/requirements
Response Format
On success, the operation responds with HTTP status code 200. The response is a JSON object with information on the added requirement.
A sample response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 1029
{
"id": 1,
"title": "Add Visual Studio integration",
"status": "Active",
"active": "true",
"project_id": 11873,
"__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,
"custom_fields": [
{
"id": "Custom1",
"name": "Area",
"value": ""
}
],
"date_created": "2015-09-10T05:39:19.9670000",
"date_last_escalated": "0001-01-01T00:00:00.0000000",
"date_opened": "2015-09-10T05:39:19.9670000",
"date_updated": "2015-09-10T05:39:19.9670000",
"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,
"last_escalation_rule_id": 0,
"nbr_escalations": 0,
"nbr_events": 0,
"nbr_files": 0,
"nbr_files_not_secured": 0,
"nbr_notes": 0,
"nbr_tasks": 0,
"opened_by": 25263,
"opened_by_email": "[email protected]",
"opened_by_name": "Smith, John",
"original_id": 0,
"owner_name": "Smith, John",
"owner_user_id": 25263,
"pct_complete": 0,
"update_user_id": 25263,
"user_name": "Smith, John"
}
The authenticating user’s rights to access requirements.
Access rights:
- 0 - None
- 1 - Read
- 2 - Update
- 3 - Read and update
- 4 - Delete
- 5 - Read and delete
- 7 - Full access
An array of requirements.
Unique identifier of the requirement.
The ID of the QAComplete project that contains the requirement.
The requirement title (name).
Specifies whether the requirement is enabled (active).
The requirement status based on a choice list.
Keywords of the requirement.
The group that contains the requirement.
The sub group that contains the requirement.
Long description of the requirement. Can include HTML markup.
Business rule associated with the requirement. Can include HTML markup.
Estimated hours to finish the requirement.
Estimated start date for working on the requirement.
The estimate date of the finishing the requirement.
Actual hours spent working on the requirement.
Actual start date for working on the requirement.
The actual date when the requirement was completed.
The date and time when the requirement was last updated.
The date and time when the requirement was created.
The date and time when the requirement was opened.
The ID of the last user who updated the requirement.
For importing: the original key that was imported.
The ID of the import session, in which the requirement was imported. If the requirement was created in QAComplete, the ImportId property is equal to 0.
The ID of the user who owns the requirement.
The ID of the user the requirement is assigned to, or 0 if the requirement is not assigned to anyone.
The ID of the folder containing the requirement, or 0 if the requirement is not in any folder.
Percentage complete of requirement completing.
Estimated remaining hours for finishing the requirement.
The ID of the user who opened the requirement.
The name of the last user who updated the requirement, in the Lastname, Firstname format.
The name of the user who owns the requirement, in the Lastname, Firstname format.
The name of the user to whom the requirement is assigned, in the Lastname, Firstname format.
The latest note attached to the requirement. Can include HTML markup.
The number of files attached to the requirement.
The number of notes attached to the requirement.
The number of scheduled events associated with the requirement.
The number of tasks linked to the requirement.
The name of the folder containing the requirement, in the format ParentFolder/Subfolder/Subfolder.
The name of the user who opened the requirement, in the Lastname, Firstname format.
The e-mail address of the user who registered the requirement.
The company name of the user who registered the requirement.
Reserved.
The number of times the requirement was processed by escalation rules.
The date when the requirement was last processed by an escalation rule.
The ID of the escalation rule that processed the requirement last. 0 if no escalation rule processed the requirement.
The name of the escalation rule that processed the requirement last.
A list of custom fields and their values.
Comments to the requirement. Can include HTML markup.
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.
If does not exist, the operation returns the File or directory not found
error.