copy

Description

Copies one or more entity instances under the specified target entity.

URL

/qcbin/rest/domains/{domain}/projects/{project}/{entity collection}/copy

Examples of URLs:

/qcbin/rest/domains/{domain}/projects/{project}/requirements/copy

/qcbin/rest/domains/{domain}/projects/{project}/defects/copy

Remarks

The copy resource can be called on any entity type for which SupportsCopying is true in the entity's entity-resource-descriptor. See the entity resource.

Entities are copied with all child entities including attachments.

When a hierarchical entity is copied, the entity's subtree is copied with it. For example, copying a requirement creates a new subtree with the copied requirement at the root of the subtree. The new subtree contains copies of all the requirements that are under the source requirement. If items in the subtree have been hidden from the logged-on user by filter set in the Customization module of <Acronym>, they are not copied.

For entity types that have an defined order under the parent, the new entity is pasted at the end of the list under the target parent.

If two entities that are linked to each are copied, the new entities are linked to each other in the same relation as the source entities. For example, if requirement "a" is linked to requirement "b", and both are copied in the same operation, "copy of a" is linked to "copy of b".

If an entity is linked to a release or cycle, the new entity has the same links. For example, if "a" is linked to a release, "copy of a" is also linked to that release.

HTTP Methods

GET: N/A

PUT: N/A

DELETE: N/A.

POST: Copies the specified entity instances.

Media Type
GET
PUT
DELETE
POST
application/xml
-
-
-
check
application/json
-
-
-
check

Input

The input has the following format:

XML

Copy code
 <Copy>
        <IDs>
        <ID>i</ID>
        <ID>j</ID>
        ...
        <ID>n</ID>
        </IDs>
        <TargetParentId>a</TargetParentId>
    </Copy>

 

JSON

Copy code
{
  "IDs": [
    "i",
    "j"
    ...
  ],
  "TargetParentId": "a"
 }

The entities specified in the <ID> elements are copied under the parent specified with <TargetParentId> element.

The target parent ID is optional. For collections that are not hierarchical, the target parent ID is ignored. If the target parent ID is not passed for hierarchical collections, the new entities are created under the root entity.

Returns

One of the HTTP Return Codes.

POST returns an XML string compliant with the OutgoingCopyResults Schema that lists the details of the source and target entities or a string containing the data in another supported format. See Schema Reference.