共用方式為


Clone Operation - Clone Test Plan

複製測試計劃

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

URI 參數

名稱 位於 必要 類型 Description
organization
path True

string

Azure DevOps 組織的名稱。

planId
path True

integer

int32

要複製之測試計劃的識別碼。

project
path True

string

專案識別碼或專案名稱

api-version
query True

string

要使用的 API 版本。 這應該設定為 '5.0-preview.2',以使用此版本的 API。

要求本文

名稱 類型 Description
destinationTestPlan

TestPlan

測試計劃資源。

options

CloneOptions

suiteIds

integer[]

回應

名稱 類型 Description
200 OK

CloneOperationInformation

成功的作業

安全性

oauth2

類型: oauth2
Flow: accessCode
授權 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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

範圍

名稱 Description
vso.test_write 授與讀取、建立及更新測試計劃、案例、結果和其他測試管理相關成品的能力。

範例

範例要求

POST https://dev.azure.com/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
  ]
}

範例回覆

{
  "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://dev.azure.com/fabrikam/fabrikam-fiber-tfvc2/_apis/test/Plans/18"
  },
  "sourceObject": {
    "id": "1",
    "name": "TestPlan1",
    "url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Plans/1"
  },
  "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/2"
}

定義

名稱 Description
CloneOperationInformation

複製作業的詳細資料。

CloneOperationState

作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成

CloneOptions
CloneStatistics
IdentityRef
ReferenceLinks

表示 REST 參考連結集合的類別。

ReleaseEnvironmentDefinitionReference

發行環境資源的參考。

ResultObjectType

複製作業所產生的物件型別

ShallowReference

一些其他資源的抽象參考。 這個類別可用來提供建置資料合約,以統一方式參考其他資源,以提供輕鬆周遊連結的方式。

TestOutcomeSettings

測試結果設定

TestPlan

測試計劃資源。

TestPlanCloneRequest

CloneOperationInformation

複製作業的詳細資料。

名稱 類型 Description
cloneStatistics

CloneStatistics

複製統計資料

completionDate

string

如果作業完成,則為完成的 DateTime。 如果作業未完成,則為 DateTime.MaxValue

creationDate

string

作業啟動時的 DateTime

destinationObject

ShallowReference

目的地的淺層參考

destinationPlan

ShallowReference

目的地的淺層參考

destinationProject

ShallowReference

目的地的淺層參考

message

string

如果作業失敗,訊息會包含失敗的原因。 否則,為 Null。

opId

integer

作業的識別碼

resultObjectType

ResultObjectType

複製作業所產生的物件型別

sourceObject

ShallowReference

來源的淺層參考

sourcePlan

ShallowReference

來源的淺層參考

sourceProject

ShallowReference

來源的淺層參考

state

CloneOperationState

作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成

url

string

取得複製資訊的 URL

CloneOperationState

作業的目前狀態。 當 State 達到 Suceeded 或 Failed 時,作業就會完成

Description
failed

失敗狀態的值

inProgress

輸入狀態的值

queued

佇列狀態的值

succeeded

成功狀態的值

CloneOptions

名稱 類型 Description
cloneRequirements

boolean

如果設定為 true 需求,將會複製

copyAllSuites

boolean

從來源方案複製所有套件

copyAncestorHierarchy

boolean

複製上階 hieracrchy

destinationWorkItemType

string

複製的工作專案類型名稱

overrideParameters

object

索引鍵值組,其中索引鍵值會由 值覆寫。

relatedLinkComment

string

將新複製測試案例連結至原始 Set null 的連結批註,以無批註顯示

CloneStatistics

名稱 類型 Description
clonedRequirementsCount

integer

到目前為止複製的「要求」數目。

clonedSharedStepsCount

integer

到目前為止複製的共用步驟數目。

clonedTestCasesCount

integer

到目前為止複製的測試案例數目

totalRequirementsCount

integer

要複製的需求總數

totalTestCasesCount

integer

要複製的測試案例總數

IdentityRef

名稱 類型 Description
_links

ReferenceLinks

此欄位包含有關圖表主旨的零個或多個有趣連結。 您可以叫用這些連結來取得其他關聯性,或取得此圖表主體的詳細資訊。

descriptor

string

描述項是在系統執行時參考圖形主旨的主要方式。 此欄位可唯一識別帳戶和組織之間的相同圖表主旨。

directoryAlias

string

displayName

string

這是圖表主旨的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

此 URL 是此圖表主體來源資源的完整路由。

表示 REST 參考連結集合的類別。

名稱 類型 Description
links

object

連結的唯讀檢視。 因為參考連結是唯讀的,所以我們只想要將它們公開為唯讀。

ReleaseEnvironmentDefinitionReference

發行環境資源的參考。

名稱 類型 Description
definitionId

integer

包含發行環境定義的發行定義識別碼。

environmentDefinitionId

integer

發行環境定義的識別碼。

ResultObjectType

複製作業所產生的物件型別

Description
testPlan

計畫複製

testSuite

套件複製

ShallowReference

一些其他資源的抽象參考。 這個類別可用來提供建置資料合約,以統一方式參考其他資源,以提供輕鬆周遊連結的方式。

名稱 類型 Description
id

string

資源的識別碼

name

string

連結資源的名稱 (定義名稱、控制器名稱等。)

url

string

資源的完整 HTTP 連結

TestOutcomeSettings

測試結果設定

名稱 類型 Description
syncOutcomeAcrossSuites

boolean

設定如何在套件間顯示相同測試測試結果的值

TestPlan

測試計劃資源。

名稱 類型 Description
area

ShallowReference

測試計劃的區域。

build

ShallowReference

要測試的組建。

buildDefinition

ShallowReference

產生與此測試計劃相關聯之組建的組建定義。

description

string

測試計劃的描述。

endDate

string

測試計劃的結束日期。

id

integer

測試計劃的識別碼。

iteration

string

測試計劃的反復專案路徑。

name

string

測試計劃的名稱。

owner

IdentityRef

測試計劃的擁有者。

previousBuild

ShallowReference

一些其他資源的抽象參考。 這個類別可用來提供建置資料合約,以統一方式參考其他資源,以提供輕鬆周遊連結的方式。

project

ShallowReference

包含測試計劃的專案。

releaseEnvironmentDefinition

ReleaseEnvironmentDefinitionReference

用來從此測試計劃部署及執行自動化測試的發行環境。

revision

integer

測試計劃的修訂。

rootSuite

ShallowReference

測試計劃的根測試套件。

startDate

string

測試計劃的開始日期。

state

string

測試計劃的狀態。

testOutcomeSettings

TestOutcomeSettings

設定測試計劃下測試套件之間相同測試的行為值

updatedBy

IdentityRef

updatedDate

string

url

string

測試計劃資源的 URL。

TestPlanCloneRequest

名稱 類型 Description
destinationTestPlan

TestPlan

測試計劃資源。

options

CloneOptions

suiteIds

integer[]