You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Resource: Relationship ( /api/organisation/{organisationId}/relationshiptype/{key}/relationship/{id} )

Relationship resource - allows the retrieval, update and deletion of a single relationship

This resource supports the following methods: DELETE, GET, PUT

Methods

DELETE


Delete relationship.

Required Permissions

  • TestManagement/ManageExecutions/Edit
  • TestManagement/ManageScripts/Edit
  • TestManagement/ManageIncidents/Edit
  • TestManagement/ManageRequirements/Edit

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if request was completed successfully.
403 - ForbiddenReturned if you have insufficient permissions to delete this relationship.
404 - NotFoundReturned if organisation or relationship does not exist.

Example - Delete a single relationship

Removes a single relationship.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{organisationId}4bb709c2-e0e7-4af3-9f60-a045016a9610ID of the organisation the relationship belongs to.
{key}RequirementToRequirementAssociationThe key of the relationship type being updated.
{id}e6cc76e6-df0f-42ac-bf20-72576256d262ID of the relationship to update.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Status Code

200 - OK

GET


Retrieve a relationship (does not include it's children)

Required Permissions

  • TestManagement/ManageExecutions/View
  • TestManagement/ManageScripts/View
  • TestManagement/ManageIncidents/View
  • TestManagement/ManageRequirements/View

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if request was completed successfully.
403 - ForbiddenReturned if you have insufficient permissions to retrieve this relationship.
404 - NotFoundReturned if organisation or relationship does not exist.

Example - Retrieve a single relationship

Retrieves the details of a single realtionship.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{organisationId}4bb709c2-e0e7-4af3-9f60-a045016a9610ID of the organisation the relationship belongs to.
{key}RequirementToRequirementAssociationThe key of the relationship type being retrieved.
{id}e6cc76e6-df0f-42ac-bf20-72576256d262ID of the relationship to retrieved.

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "EntityId": "8F00D2CE-6243-4956-AF89-60B7B9755A9B",
  "Number": "1",
  "Name": "Some Requirement",
  "EntityType": "Requirement",
  "AssignedTo": "joeb",
  "Status": "Draft",
  "Priority": "High",
  "Type": "Functional",
  "PackageId": "c232382b-0c66-475b-b59b-8753d4c5377b",
  "PackageName": "Version 1",
  "PackageEntityType": "RequirementPackage",
  "PackagePath": "/Requirements/Version 1",
  "RelationshipId": "e6cc76e6-df0f-42ac-bf20-72576256d262",
  "RelationshipTypeKey": "RequirementToRequirementAssociation",
  "RelationshipType": "Associated",
  "Relation": "Association",
  "RelationshipDirection": "Source -> Destination",
  "CanDelete": true,
  "CanEdit": false,
  "Children": [],
  "Links": [
    {
      "Href": "http://localhost/api",
      "Rel": "Entity"
    }
  ]
}

Status Code

201 - Created

PUT


Update the direction of a relationship

Required Permissions

  • TestManagement/ManageExecutions/Edit
  • TestManagement/ManageScripts/Edit
  • TestManagement/ManageIncidents/Edit
  • TestManagement/ManageRequirements/Edit

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if you have insufficient permissions to update the relationship.
404 - NotFoundReturned if organisation or relationship does not exist.

Example - Update the direction of a relationship

Updates the direction of a relationship (This is the only supported type of a update you can apply to a relationship, to change it's source or destination end you must be delete the existing relationship and create a new one.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{organisationId}4bb709c2-e0e7-4af3-9f60-a045016a9610ID of the organisation the relationship belongs to.
{key}RequirementToRequirementAssociationThe key of the relationship type being updated.
{id}e6cc76e6-df0f-42ac-bf20-72576256d262ID of the relationship to update.

Request Body

{
  "RelationshipDirection": "SourceToDestination"
}

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "EntityId": "8F00D2CE-6243-4956-AF89-60B7B9755A9B",
  "Number": "1",
  "Name": "Some Requirement",
  "EntityType": "Requirement",
  "AssignedTo": "joeb",
  "Status": "Draft",
  "Priority": "High",
  "Type": "Functional",
  "PackageId": "c232382b-0c66-475b-b59b-8753d4c5377b",
  "PackageName": "Version 1",
  "PackageEntityType": "RequirementPackage",
  "PackagePath": "/Requirements/Version 1",
  "RelationshipId": "e6cc76e6-df0f-42ac-bf20-72576256d262",
  "RelationshipTypeKey": "RequirementToRequirementAssociation",
  "RelationshipType": "Associated",
  "Relation": "Association",
  "RelationshipDirection": "Source -> Destination",
  "CanDelete": true,
  "CanEdit": false,
  "Children": [],
  "Links": [
    {
      "Href": "http://localhost/api",
      "Rel": "Entity"
    }
  ]
}

Status Code

201 - Created

  • No labels