Clone Operation - Clone Test Suite

Clone test suite

POST https://dev.azure.com/{organization}/{project}/_apis/test/Plans/{planId}/Suites/{sourceSuiteId}/cloneoperation?api-version=5.0-preview.2

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

planId
path True

integer

int32

ID of the test plan in which suite to be cloned is present

project
path True

string

Project ID or project name

sourceSuiteId
path True

integer

int32

ID of the test suite to be cloned

api-version
query True

string

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
cloneOptions

CloneOptions

Clone options for cloning the test suite.

destinationSuiteId

integer

Suite id under which, we have to clone the suite.

destinationSuiteProjectName

string

Destination suite project name.

Responses

Name Type Description
200 OK

CloneOperationInformation

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://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1/Suites/{sourceSuiteId}/cloneoperation?api-version=5.0-preview.2

{
  "destinationSuiteId": 13,
  "destinationSuiteProjectName": "fabrikam-fiber-tfvc2",
  "cloneOptions": {
    "copyAncestorHierarchy": true,
    "overrideParameters": {
      "System.AreaPath": "fabrikam-fiber-tfvc2",
      "System.IterationPath": "fabrikam-fiber-tfvc2"
    }
  }
}

Sample response

{
  "opId": 3,
  "creationDate": "0001-01-01T00:00:00",
  "completionDate": "0001-01-01T00:00:00",
  "state": "queued",
  "message": null,
  "cloneStatistics": null,
  "resultObjectType": "testSuite",
  "destinationObject": {
    "id": "14",
    "name": "simpleCloned",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc2/_apis/test/Plans/13/Suites/14"
  },
  "sourceObject": {
    "id": "1",
    "name": "TestSuite1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1/Suites/2"
  },
  "destinationPlan": {
    "id": "18",
    "name": "DestinationPlan",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc2/_apis/test/Plans/18"
  },
  "sourcePlan": {
    "id": "1",
    "name": "TestPlan1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
  },
  "destinationProject": {
    "name": "fabrikam-fiber-tfvc2",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/fabrikam-fiber-tfvc2"
  },
  "sourceProject": {
    "name": "fabrikam-fiber-tfvc",
    "url": "https://dev.azure.com/fabrikam/_apis/projects/fabrikam-fiber-tfvc"
  },
  "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/cloneOperation/3"
}

Definitions

Name Description
CloneOperationInformation

Detail About Clone Operation.

CloneOperationState

Current state of the operation. When State reaches Suceeded or Failed, the operation is complete

CloneOptions
CloneStatistics
ResultObjectType

The type of the object generated as a result of the Clone operation

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.

TestSuiteCloneRequest

Test suite clone request

CloneOperationInformation

Detail About Clone Operation.

Name Type Description
cloneStatistics

CloneStatistics

Clone Statistics

completionDate

string

If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue

creationDate

string

DateTime when the operation was started

destinationObject

ShallowReference

Shallow reference of the destination

destinationPlan

ShallowReference

Shallow reference of the destination

destinationProject

ShallowReference

Shallow reference of the destination

message

string

If the operation has Failed, Message contains the reason for failure. Null otherwise.

opId

integer

The ID of the operation

resultObjectType

ResultObjectType

The type of the object generated as a result of the Clone operation

sourceObject

ShallowReference

Shallow reference of the source

sourcePlan

ShallowReference

Shallow reference of the source

sourceProject

ShallowReference

Shallow reference of the source

state

CloneOperationState

Current state of the operation. When State reaches Suceeded or Failed, the operation is complete

url

string

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

string

value for Failed State

inProgress

string

value for Inprogress state

queued

string

Value for Queued State

succeeded

string

value for Success state

CloneOptions

Name Type Description
cloneRequirements

boolean

If set to true requirements will be cloned

copyAllSuites

boolean

copy all suites from a source plan

copyAncestorHierarchy

boolean

copy ancestor hieracrchy

destinationWorkItemType

string

Name of the workitem type of the clone

overrideParameters

object

Key value pairs where the key value is overridden by the value.

relatedLinkComment

string

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

integer

Number of Requirments cloned so far.

clonedSharedStepsCount

integer

Number of shared steps cloned so far.

clonedTestCasesCount

integer

Number of test cases cloned so far

totalRequirementsCount

integer

Total number of requirements to be cloned

totalTestCasesCount

integer

Total number of test cases to be cloned

ResultObjectType

The type of the object generated as a result of the Clone operation

Name Type Description
testPlan

string

Plan Clone

testSuite

string

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

string

ID of the resource

name

string

Name of the linked resource (definition name, controller name, etc.)

url

string

Full http link to the resource

TestSuiteCloneRequest

Test suite clone request

Name Type Description
cloneOptions

CloneOptions

Clone options for cloning the test suite.

destinationSuiteId

integer

Suite id under which, we have to clone the suite.

destinationSuiteProjectName

string

Destination suite project name.