Requirement Package
Resource: Requirement Package ( /api/requirementpackage/{id} )
Requirement Package resource
This resource supports the following methods: DELETE, GET, PUT
Methods
DELETE
Deletes a requirement package by its unique identifier.
Required Permissions
TestManagement/ManageRequirements/Edit
TestManagement/ManageRequirements/Delete
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).
Status | Description |
|---|---|
200 - OK | Returned if the requirement package was deleted successfully. |
403 - Forbidden | Returned if the requirement package can not be deleted (normally because the required permissions have not been met, or the package has children but you did not pass the deleteChildren parameter). |
404 - NotFound | Returned if the requirement package was not found. |
Example - Delete empty package
An example of deleting a package.
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of package to delete. |
Status Code
200 - OK
Example - Delete package with children
An example of deleting a package with children.
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of the package to delete. |
deleteChildren | true | Will delete a package and all its children. |
Status Code
200 - OK
Example - Delete package with children (without deleteChildren parameter)
An example of deleting a non-empty package without deleteChildren=true.
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of the package to delete. |
Response Body
{
"Message": "The package is not empty."
}
Status Code
403 - Forbidden
GET
Retrieves a requirement package by its unique identifier.
Required Permissions
TestManagement/ManageRequirements/View
Supported Expansions
For more details on expansions, please see the Expand help topic.
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).
Status | Description |
|---|---|
200 - OK | Returned if the request was completed successfully. |
Example - GET
Example of retrieving a package by its unique identifier.
Request Headers
Key | Value | Description |
|---|---|---|
Accept | application/json |
|
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of package to retrieve. |
Response Headers
Key | Value | Description |
|---|---|---|
Content-Type | application/json; charset=utf-8 |
|
Response Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"ParentId": "cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Name": "New Package Name",
"OrderNumber": 1,
"Expands": [
"Children",
"Parent",
"Project"
],
"Self": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Links": [
{
"Href": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610/children",
"Rel": "Children"
},
{
"Href": "http://localhost/api/requirementpackage/cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Rel": "Parent"
}
]
}
Status Code
200 - OK
PUT
Update a requirement package.
Required Permissions
TestManagement/ManageRequirements/Edit
Supported Expansions
For more details on expansions, please see the Expand help topic.
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).
Status | Description |
|---|---|
200 - OK | Returned if the request was completed successfully. |
403 - Forbidden | Returned if the user does not have permission to create requirement packages in the target project. |
404 - NotFound | Returned if the package does not exist. |
Example - PUT (update package name)
Updating a package's name.
Request Headers
Key | Value | Description |
|---|---|---|
Accept | application/json |
|
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of the package to update. |
Request Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Name": "New Package Name"
}
Response Headers
Key | Value | Description |
|---|---|---|
Content-Type | application/json; charset=utf-8 |
|
Response Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"ProjectId": "944aa658-8067-42cf-a6a6-ce71535a73bc",
"Name": "New Package Name",
"OrderNumber": 1,
"Expands": [
"Children",
"Parent",
"Project"
],
"Self": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Links": [
{
"Href": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610/children",
"Rel": "Children"
},
{
"Href": "http://localhost/api/project/944aa658-8067-42cf-a6a6-ce71535a73bc",
"Rel": "Project"
}
]
}
Status Code
200 - OK
Example - PUT (move package to new parent)
Updating package to have a different parent package.
Request Headers
Key | Value | Description |
|---|---|---|
Accept | application/json |
|
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of the package to update. |
Request Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"ParentId": "cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6"
}
Response Headers
Key | Value | Description |
|---|---|---|
Content-Type | application/json; charset=utf-8 |
|
Response Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"ParentId": "cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Name": "New Package Name",
"OrderNumber": 1,
"Expands": [
"Children",
"Parent",
"Project"
],
"Self": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Links": [
{
"Href": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610/children",
"Rel": "Children"
},
{
"Href": "http://localhost/api/requirementpackage/cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Rel": "Parent"
}
]
}
Status Code
200 - OK
Example - PUT (update multiple details)
Updating package name, stereotype, order and parent.
Request Headers
Key | Value | Description |
|---|---|---|
Accept | application/json |
|
Request Parameters
Key | Value | Description |
|---|---|---|
{id} | 4bb709c2-e0e7-4af3-9f60-a045016a9610 | GUID Identifier of the package to update. |
Request Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Name": "New Package Name",
"OrderNumber": 2,
"ParentId": "cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6"
}
Response Headers
Key | Value | Description |
|---|---|---|
Content-Type | application/json; charset=utf-8 |
|
Response Body
{
"Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
"ParentId": "cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Name": "New Package Name",
"OrderNumber": 2,
"Expands": [
"Children",
"Parent",
"Project"
],
"Self": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610",
"Links": [
{
"Href": "http://localhost/api/requirementpackage/4bb709c2-e0e7-4af3-9f60-a045016a9610/children",
"Rel": "Children"
},
{
"Href": "http://localhost/api/requirementpackage/cc91ec0b-a9f2-44fe-bf86-97ecb98cecc6",
"Rel": "Parent"
}
]
}
Status Code
200 - OK