Clone Operation - Clone Test Plan
Clone test plan
POST https://{instance}/{collection}/{project}/_apis/test/Plans/{planId}/cloneoperation?api-version=5.0-preview.2
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
collection
|
path | True |
|
The name of the Azure DevOps collection. |
instance
|
path | True |
|
Azure DevOps server name ({server:port}) |
plan
|
path | True |
|
ID of the test plan to be cloned. |
project
|
path | True |
|
Project ID or project name |
api-version
|
query | True |
|
Version of the API to use. This should be set to '5.0-preview.2' to use this version of the api. |
Request Body
Name | Type | Description |
---|---|---|
destinationTestPlan |
The test plan resource. |
|
options | ||
suiteIds |
|
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.test_write | Grants the ability to read, create, and update test plans, cases, results and other test management related artifacts. |
Examples
Sample Request
POST https://{instance}/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1/cloneoperation?api-version=5.0-preview.2
{
"destinationTestPlan": {
"name": "DestinationSuite",
"Project": {
"Name": "fabrikam-fiber-tfvc2"
}
},
"options": {
"copyAncestorHierarchy": true,
"copyAllSuites": true,
"overrideParameters": {
"System.AreaPath": "fabrikam-fiber-tfvc2",
"System.IterationPath": "fabrikam-fiber-tfvc2"
}
},
"suiteIds": [
2
]
}
Sample Response
{
"opId": 2,
"creationDate": "0001-01-01T00:00:00",
"completionDate": "0001-01-01T00:00:00",
"state": "queued",
"message": null,
"cloneStatistics": null,
"resultObjectType": "testPlan",
"destinationObject": {
"id": "18",
"name": "DestinationPlan",
"url": "https://fabrikam:8080/tfs/fabrikam-fiber-tfvc2/_apis/test/Plans/18"
},
"sourceObject": {
"id": "1",
"name": "TestPlan1",
"url": "https://fabrikam:8080/tfs/fabrikam-fiber-tfvc/_apis/test/Plans/1"
},
"destinationPlan": {
"id": "18",
"name": "DestinationPlan",
"url": "https://fabrikam:8080/tfs/fabrikam-fiber-tfvc2/_apis/test/Plans/18"
},
"sourcePlan": {
"id": "1",
"name": "TestPlan1",
"url": "https://fabrikam:8080/tfs/fabrikam-fiber-tfvc/_apis/test/Plans/1"
},
"destinationProject": {
"name": "fabrikam-fiber-tfvc2",
"url": "https://fabrikam:8080/tfs/_apis/projects/fabrikam-fiber-tfvc2"
},
"sourceProject": {
"name": "fabrikam-fiber-tfvc",
"url": "https://fabrikam:8080/tfs/_apis/projects/fabrikam-fiber-tfvc"
},
"url": "https://fabrikam:8080/tfs/fabrikam-fiber-tfvc/_apis/test/cloneOperation/2"
}
Definitions
Clone |
Detail About Clone Operation. |
Clone |
Current state of the operation. When State reaches Suceeded or Failed, the operation is complete |
Clone |
|
Clone |
|
Identity |
|
Reference |
The class to represent a collection of REST reference links. |
Release |
Reference to release environment resource. |
Result |
The type of the object generated as a result of the Clone operation |
Shallow |
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. |
Test |
Test outcome settings |
Test |
The test plan resource. |
Test |
CloneOperationInformation
Detail About Clone Operation.
Name | Type | Description |
---|---|---|
cloneStatistics |
Clone Statistics |
|
completionDate |
|
If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue |
creationDate |
|
DateTime when the operation was started |
destinationObject |
Shallow reference of the destination |
|
destinationPlan |
Shallow reference of the destination |
|
destinationProject |
Shallow reference of the destination |
|
message |
|
If the operation has Failed, Message contains the reason for failure. Null otherwise. |
opId |
|
The ID of the operation |
resultObjectType |
The type of the object generated as a result of the Clone operation |
|
sourceObject |
Shallow reference of the source |
|
sourcePlan |
Shallow reference of the source |
|
sourceProject |
Shallow reference of the source |
|
state |
Current state of the operation. When State reaches Suceeded or Failed, the operation is complete |
|
url |
|
Url for geting the clone information |
CloneOperationState
Current state of the operation. When State reaches Suceeded or Failed, the operation is complete
Name | Type | Description |
---|---|---|
failed |
|
value for Failed State |
inProgress |
|
value for Inprogress state |
queued |
|
Value for Queued State |
succeeded |
|
value for Success state |
CloneOptions
Name | Type | Description |
---|---|---|
cloneRequirements |
|
If set to true requirements will be cloned |
copyAllSuites |
|
copy all suites from a source plan |
copyAncestorHierarchy |
|
copy ancestor hieracrchy |
destinationWorkItemType |
|
Name of the workitem type of the clone |
overrideParameters |
|
Key value pairs where the key value is overridden by the value. |
relatedLinkComment |
|
Comment on the link that will link the new clone test case to the original Set null for no comment |
CloneStatistics
Name | Type | Description |
---|---|---|
clonedRequirementsCount |
|
Number of Requirments cloned so far. |
clonedSharedStepsCount |
|
Number of shared steps cloned so far. |
clonedTestCasesCount |
|
Number of test cases cloned so far |
totalRequirementsCount |
|
Total number of requirements to be cloned |
totalTestCasesCount |
|
Total number of test cases to be cloned |
IdentityRef
Name | Type | Description |
---|---|---|
_links |
This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. |
|
descriptor |
|
The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and collections. |
directoryAlias |
|
|
displayName |
|
This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. |
id |
|
|
imageUrl |
|
|
inactive |
|
|
isAadIdentity |
|
|
isContainer |
|
|
isDeletedInOrigin |
|
|
profileUrl |
|
|
uniqueName |
|
|
url |
|
This url is the full route to the source resource of this graph subject. |
ReferenceLinks
The class to represent a collection of REST reference links.
Name | Type | Description |
---|---|---|
links |
|
The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. |
ReleaseEnvironmentDefinitionReference
Reference to release environment resource.
Name | Type | Description |
---|---|---|
definitionId |
|
ID of the release definition that contains the release environment definition. |
environmentDefinitionId |
|
ID of the release environment definition. |
ResultObjectType
The type of the object generated as a result of the Clone operation
Name | Type | Description |
---|---|---|
testPlan |
|
Plan Clone |
testSuite |
|
Suite Clone |
ShallowReference
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.
Name | Type | Description |
---|---|---|
id |
|
ID of the resource |
name |
|
Name of the linked resource (definition name, controller name, etc.) |
url |
|
Full http link to the resource |
TestOutcomeSettings
Test outcome settings
Name | Type | Description |
---|---|---|
syncOutcomeAcrossSuites |
|
Value to configure how test outcomes for the same tests across suites are shown |
TestPlan
The test plan resource.
Name | Type | Description |
---|---|---|
area |
Area of the test plan. |
|
build |
Build to be tested. |
|
buildDefinition |
The Build Definition that generates a build associated with this test plan. |
|
description |
|
Description of the test plan. |
endDate |
|
End date for the test plan. |
id |
|
ID of the test plan. |
iteration |
|
Iteration path of the test plan. |
name |
|
Name of the test plan. |
owner |
Owner of the test plan. |
|
previousBuild |
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. |
|
project |
Project which contains the test plan. |
|
releaseEnvironmentDefinition |
Release Environment to be used to deploy the build and run automated tests from this test plan. |
|
revision |
|
Revision of the test plan. |
rootSuite |
Root test suite of the test plan. |
|
startDate |
|
Start date for the test plan. |
state |
|
State of the test plan. |
testOutcomeSettings |
Value to configure how same tests across test suites under a test plan need to behave |
|
updatedBy | ||
updatedDate |
|
|
url |
|
URL of the test plan resource. |
TestPlanCloneRequest
Name | Type | Description |
---|---|---|
destinationTestPlan |
The test plan resource. |
|
options | ||
suiteIds |
|