POST/projects/{ProjectId}/requirements

Applies to QAComplete 14.3, last modified on February 19, 2024

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:

http://{server}/rest-api/service/api/v1/projects/{ProjectId}/requirements
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"
}

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.

See Also

Requirements Resources

Highlight search results