POST/projects/{ProjectId}/{EntityCode}/{EntityId}/files

Applies to QAComplete 14.5, last modified on August 06, 2024

Creates a new link between items in QAComplete.

Use the operation to create a new link between the specified entities in QAComplete.

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 Update privilege for the entity (Defects, Tests, and so on) which you want to link to another one.

Request Format

To link one item to another, send a POST request with Content-Type application/json to the following URL:

http://{server}/rest-api/service/api/v1/projects/{ProjectId}/{EntityCode}/{EntityId}/linkeditems
URL parameters

ProjectId  :  integer, required

The ID of the project, to which the item belongs.

EntityCode  :  string, required

The type of item being linked. Possible values:

  • Releases
  • Bugs (defects)
  • FunctionalSpecs (requirements)
  • Tests
  • TestSets
  • TestSteps

EntityId  :  integer, required

The ID of item being linked.

Body parameters

In the request body, pass the RequestLinkedItemPost object that describes the link to be created.


{
  "LinkedEntityCode": "string",
  "LinkedEntityId": "int"
}

LinkedEntityCode  :  string, required

The entity code of the link’s target item. Possible values:

  • Releases
  • Bugs (defects)
  • FunctionalSpecs (requirements)
  • Tests
  • TestSets
  • TestSteps

LinkedEntityId  :  integer, required

The link’s target item’s id.

A sample request:

POST http://yourserver.com/rest-api/service/api/v1/projects/11873/FunctionalSpecs/linkeditems HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 92


{
  "LinkedEntityCode": "Bugs",
  "LinkedEntityId": 3714539
}

A sample request made by using cURL:

curl -u [email protected]:p@ssword -d @linkeditem.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/FunctionalSpecs/linkeditems

Response Format

If successful, the operation responds with HTTP status code 200. The response is a JSON object with information on the newly created link.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 388



{
  "link_id": 3277942,
  "entity_code": "Bugs",
  "entity_id": 3714539,
  "linked_entity_code": "FunctionalSpecs",
  "linked_entity_id": 1663742,
  "title": "Sample Requirement",
  "is_active": true,
  "status": "Active",
  "date_updated": "2017-04-10T12:16:26.7730000",
  "update_user_id": 135027,
  "updated_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 the specified entity does not exist, the operation returns the 'Invalid entity code' error.

See Also

Linked Items Resources

Highlight search results