Resource: Script Assignment ( /api/scriptassignment/{id} )

Script Assignment resource

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

Methods

DELETE


Deletes a single script assignment by its unique identifier.

Required Permissions

  • TestManagement/ManageExecution

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 do not have permission to delete this script assignment.
404 - NotFoundReturned if no script assignment with that identifier exists.

Example - Delete assignment

An Example of deleting a script assignment.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The GUID Identifier of the script assignment to delete.

Response Headers

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

Status Code

200 - OK

GET


Retrieves a single script assignment by its unique identifier.

Required Permissions

  • TestManagement/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).

StatusDescription
200 - OKReturned if the request was completed successfully.
403 - ForbiddenReturned if you do not have permission to view this script assignment.
404 - NotFoundReturned if no script assignment with that identifier exists.

Example - GET

An example of retrieving a script assignment.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The GUID Identifier of assignment to retrieve.

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "ScriptId": "5ef6c545-6ef8-472e-bae7-b1cc3d3fbab0",
  "Name": "My Script",
  "Status": "Not Run",
  "AssignedTo": null,
  "AssignedToId": null,
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "Expands": [
    "Package"
  ],
  "Self": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/executionpackage/f6ed1282-bd89-4f8f-8e94-47e344bba905",
      "Rel": "ExecutionPackage"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/runs",
      "Rel": "Runs"
    },
    {
      "Href": "http://localhost/api/script/5ef6c545-6ef8-472e-bae7-b1cc3d3fbab0",
      "Rel": "Script"
    }
  ]
}

Status Code

200 - OK

PUT


Update script assignment

Required Permissions

  • TestManagement/ManageExecution

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).

StatusDescription
200 - OKReturned if the script assignment was updated successfully.
403 - ForbiddenReturned if the request could not be completed successfuly (normally due to lack of permissions or validation failure).

Example - PUT (update package for the script assignment)

Updating the package which the script assignment belongs to.

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The GUID Identifier of package to delete.

Request Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f"
}

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f",
  "Name": "My Script",
  "Status": "Not Run",
  "AssignedTo": null,
  "AssignedToId": null,
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "Expands": [
    "Package"
  ],
  "Self": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/executionpackage/f6ed1282-bd89-4f8f-8e94-47e344bba905",
      "Rel": "ExecutionPackage"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/runs",
      "Rel": "Runs"
    },
    {
      "Href": "http://localhost/api/script/888f8e22-0137-440a-bcf2-173b9d6f543f",
      "Rel": "Script"
    }
  ]
}

Status Code

200 - OK

Example - PUT (assign script assignment to user)

Updating a script assignment to be assigned to a new user (this does not change the tester for any active script runs associated with this assignment).

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The GUID Identifier of package to delete

Request Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "AssignedToId": "203f8f8a-20a7-40ff-bb9c-dbed4fcfcd98",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f"
}

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f",
  "Name": "My Script",
  "Status": "Not Run",
  "AssignedTo": "joeb",
  "AssignedToId": "203f8f8a-20a7-40ff-bb9c-dbed4fcfcd98",
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "Expands": [
    "Package"
  ],
  "Self": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/executionpackage/f6ed1282-bd89-4f8f-8e94-47e344bba905",
      "Rel": "ExecutionPackage"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/runs",
      "Rel": "Runs"
    },
    {
      "Href": "http://localhost/api/script/888f8e22-0137-440a-bcf2-173b9d6f543f",
      "Rel": "Script"
    }
  ]
}

Status Code

200 - OK

Example - PUT (unassign a previously assigned script)

Updating a script assignment to be unassigned (a null value cannot be passed because this will be ignored, due the implementation of partial updates so an empty GUID is passed instead).

Request Headers

KeyValueDescription
Acceptapplication/json

Request Parameters

KeyValueDescription
{id}4bb709c2-e0e7-4af3-9f60-a045016a9610The GUID Identifier of the package to delete.

Request Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "AssignedToId": "00000000-0000-0000-0000-000000000000",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f"
}

Response Headers

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

Response Body

{
  "Id": "4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "ScriptId": "888f8e22-0137-440a-bcf2-173b9d6f543f",
  "Name": "My Script",
  "Status": "Not Run",
  "AssignedTo": null,
  "AssignedToId": null,
  "PackageId": "f6ed1282-bd89-4f8f-8e94-47e344bba905",
  "Expands": [
    "Package"
  ],
  "Self": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610",
  "Links": [
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/allrelationships",
      "Rel": "AllRelationships"
    },
    {
      "Href": "http://localhost/api/executionpackage/f6ed1282-bd89-4f8f-8e94-47e344bba905",
      "Rel": "ExecutionPackage"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/relationships",
      "Rel": "Relationships"
    },
    {
      "Href": "http://localhost/api/scriptassignment/4bb709c2-e0e7-4af3-9f60-a045016a9610/runs",
      "Rel": "Runs"
    },
    {
      "Href": "http://localhost/api/script/888f8e22-0137-440a-bcf2-173b9d6f543f",
      "Rel": "Script"
    }
  ]
}

Status Code

200 - OK

  • No labels