Process Execute API

cahscm140
This article describes the following Rest APIs:
The Process Execute REST API allows you to execute a process.
A process is a command that executes an action. CA Harvest SCM includes a predefined set of process types. You can define a set of processes for each state in the life cycle. The processes that are defined for a state determine what activities users can perform on that state.
You can fetch the Process API details in the following ways:
  • Get the required projectId through GET /projects call.
    For more information, see List Project Calls
  • Get the required stateId through GET /states call.
    For more information, see List States Calls.
  • Get the required processId through GET /processes call.
    For more information, see fList Processes Calls.
URL Structure
All the process action API have the same URL structure.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
where:
  • projectId
    : Uniquely identifies Harvest Project.
  • stateId
    : Uniquely identifies Harvest State.
  • processId
    : Id of the process to be executed.
Prerequisite
Use Login API to get Harvest-SCM-LogonToken. You can find Harvest-SCM-LogonToken both in the response body and cookie . For further REST calls Harvest-SCM-LogonToken can be added either in Cookie or header of the request.. For more information, see Authentication Call.
To execute a process, perform the following steps:
  1. Get the required projectId through GET /projects call.
  2. Get the required stateId through GET /states call.
  3. Get the required processId through GET /processes call.
  4. Now you can call execute on the required process using PUT .../processes/{processId}/execute.
Create Package Process
The create package process action allows you to define the
CA Harvest SCM
package. For more information, see Package Actions API.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
name [integer]
Enter the name of the package to be created.
assignedTo [integer]
Specifies the id of the User to which the package to be assigned.
comment [string]
Enter the comment if any.
Example Use Case: Create a Package with name “Smart Card Authentication”
Sample Request
{ "name":"Smart Card Authentication", "comment": "Implement Harvest Login through Smart Card" }
Sample Response
Status: 200 (OK)
{ "status": "success", "message": "I000206ad: Created package Smart Card Authentication." }
Example Use Case - Execute Create Package process with “Get” Request type
Status: 405 (Method Not Allowed)
Example Use Case: Create a Package with an Existing Name
Status: 422 (Unprocessable Entity)
{ "timestamp": "2020-05-10T16:31:58.353+0000", "status": 422, "errors": [ "E03020005: The package name, Smart Card Authentication, has already been used in this project." ], "path": "/harvest-scm/rest/projects/15/states/59/processes/413/execute" }
Delete Package Process
The delete package process execution lets you delete a package. It also deletes the associated form if it is not associated with any another package.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
packageId [integer]
A unique ID to represent CA Harvest SCM package.
This is a mandatory parameter.
Example Use Case: Deleting a package with a given package object ID.
Sample Request
{ "packageId":9 }
Sample Response
Status: 200 (OK)
{ "status": "success", "message": "I00020060: Deleted package Smart Card Authentication. I00020019: The Delete Package Process execution was successful." }
Status: 422 (Unprocessable Entity)
{ "timestamp": "2020-05-10T16:41:08.262+0000", "status": 422, "errors": [ "ER1000422: \"packageId\" must not be null" ], "path": "/harvest-scm/rest/projects/15/states/59/processes/415/execute" }
Approve Process - Package/Package Group
The Approve process execution lets you approve/reject the packages/package groups.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
packageIds
/
packageGroupIds
[integer array]
Array of Harvest Package/PackageGroup Ids.
This is a mandatory parameter.
comment
[string]
Enter the comment if any.
approve
[boolean]
true – approves the packages
false – rejects the packages
Example Use Case - Approving multiple packages with a single execute call
  • Package Name
    : “Smart Card Authentication Server Side” [Object Id : 14]
  • Package Name
    : “Smart Card Authentication Client Side” [Object Id :15]
Sample Request
{ "packageIds" : [14,15], "approve": true, "comment" : "Approving the feature" }
Sample Response
Status: 200 (OK)
{ "status": "success", "message": "I00020136: Approve process successful for package : Smart Card Authentication Client Side. Package is frozen. I00020136: Approve process successful for package : Smart Card Authentication Server Side. Package is frozen." }
Status: 422 (if we do not specify the packageIds/packageGroupIds)
{ "timestamp": "2020-05-10T17:02:03.597+0000", "status": 422, "errors": [ "ER1000422: Provide either packageIds or packageGroupIds." ], "path": "/harvest-scm/rest/projects/15/states/59/processes/442/execute" }
Example Use Case: Approve Package with a user not in the approval list.
Sample Request
{ "packageIds" : [14,15], "approve": true }
Sample Response
Status: 401 (Unauthorized)
{ "timestamp": "2020-01-17T08:55:40.240+0000", "status": 401, "errors": [ "E03020030: Cannot execute this process; the current user is not in the approve/reject user list."], "path": "/harvest-scm/rest/projects/18/states/75/processes/555/execute" }
Promote Process - Package/Package Group
The promote process execution lets you send one or more packages in the current state to the next state in the life cycle.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
packageIds
or
packageGroupIds
[integer array]
This is a mandatory parameter.
Specifies Array of Harvest Package/PackageGroup IDs.
enforcePkgMerge [Boolean]
Prohibits promoting packages to the next state if the packages are associated with branch versions.
Note
: If you do not specify a value, the value that is set in a process is used.
enforcePkgBind [Boolean]
Promotes all the packages belonging to a bound package group.
Note
: If you do not specify a value, the value that is set in a process is used.
verifyPkgDependency [Boolean]
Prohibits promoting packages that depend upon other packages. The dependency is based on versions in the view. You cannot promote a package with a higher item-version without also promoting the packages with the lower item-versions in the current view unless the lower item-versions already exist in the view of the destination state.
Note
: If you do not specify a value, the value that is set in a process is used.
addDependentPkgs [Boolean]
Allows adding dependent packages to the list of packages that are promoted.
Example Use Case – Promoting a Package with a Given Objid.
Sample Request
{ "packageIds":[14] }
Sample Response
Status: 200 (OK)
{ "status": "success", "message": "I00020017: The package Smart Card Authentication Server Side has been promoted to Test.\nI00020015: The process execution completed successfully. The package count is: 1. }
Example Use Case: Package Group Name: Smart Card Authentication
Bind Packages enabled with following two packages:
  • Smart Card Authentication Client Side (Objid-15)
  • Smart Card Authentication Server Side (Objid-14)
Sample Request
{ "packageIds":[14], "enforcePkgBind":true }
Sample Response
Status: 412 (Precondition Failed)
{ "timestamp": "2020-05-10T17:26:09.173+0000", "status": 412, "errors": [ "E03060023: Process Verify failed. Process Name: Promote to Test.\nE03020016: The package Smart Card Authentication Server Side has not been approved.\nI0002002e: The approval process, Approve, has a user, harvest, who has not approved package Smart Card Authentication Server Side.\nI0002002e: The approval process, Approve, has a user, ANEGA01, who has not approved package Smart Card Authentication Server Side.\nE03020011: The package Promote verification failed." ], "path": "/harvest-scm/rest/projects/15/states/59/processes/423/execute" }
Demote Process - Package/Package Group
The demote process lets you move one or more packages in the current state to a previous state in the lifecycle
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
packageIds
or
packageGroupIds [integer array]
This is a mandatory parameter.
Specifies array of Harvest Package/PackageGroup IDs.
enforcePkgBind
[Boolean]
Demotes all the packages belonging to a bound package group together.
Note
: If you do not specify a value, the value that is set in a process is used.
verifyPkgDependency
[Boolean]
Prohibits demoting packages that depend upon other packages. The dependency is based on versions in the view. You cannot demote a package with a higher item-version without also demoting the packages with the lower item-versions in the current view unless the lower item-versions already exist in the view of the destination state.
Note
: If you do not specify a value, the value that is set in a process is used.
addDependentPkgs
[Boolean]
Allows adding dependent packages also to the list of packages being promoted.
Example Use Case: Demote a Package Group
Sample Request:
{ "packageGroupIds" : [1] }
Sample Response:
Status: 200 (OK)
{ "status": "success", "message": "I00020018: The package Smart Card Authentication Client Side has been demoted to Development. I00020018: The package Smart Card Authentication Server Side has been demoted to Development. I00020015: The process execution completed successfully. The package count is: 2.” }
Switch Package Process
The switch package process execution lets you move versions from source package to a target package.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
sourcePackageId [integer]
Specifies the harvest Package ID from which the versions will be moved
.
This is a mandatory parameter.
targetPackageId
[integer]
Specifies the Harvest Package ID to which the versions will be moved.
This is a mandatory parameter.
versionIds
[integer array]
List of Harvest Version IDs separated by comma.
This is a mandatory parameter.
Example Use Case: Moving a branch version to a target package with existing version of the same item
  • Source Package – “Smart Card Authentication Server Side” - Objid – 14
  • Version – CIRCLE.C :0.1.1 – Objid – 2003
  • Target Package – “Smart Card Authentication Client Side” – Objid – 15
  • Version – CIRCLE.C:1
Sample Request:
{ "sourcePackageId" : "14", "targetPackageId": "15", "versionIds":[2003] }
Sample Response:
Status: 422 (Bad Request)
{ "timestamp": "2020-05-18T14:26:47.126+0000", "status": 422, "errors": [ "E03020597: Branch version CIRCLE.C cannot be moved to a package with an existing version of that item" ], "path": "/harvest-scm/rest/projects/15/states/59/processes/429/execute" }
UDP Process
The UDP process execution lets you execute any server side user defined process.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request body parameters
packageIds
A unique set of characters used to identify a package.
versionsIds
A unique set of characters used to identify a version.
Sample Request
{ "packageIds":[14,15], "versionIds":[380,381] }
  • Source Package – “Smart Card Authentication Server Side” - Objid – 14
  • Version – CIRCLE.C :0.1.1 – Objid – 2003
  • Target Package – “Smart Card Authentication Client Side” – Objid – 15
  • Version – CIRCLE.C:1
Sample Response
Status: 200 (OK)
{ "status":"success", "message":"Job submitted sucessfully" }
Delete Version in a Package
The delete version process when executed at package level lets you delete all versions in a package. VersionIds can be provided to delete a specific set of versions. For more information, see Package Actions API.
This API is supported and available in CA Harvest SCM v14.0.1.
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
URL Parameters
processId
A unique ID to represent a delete version process.
This is a
mandatory
parameter.
projectId
Unique ID that represents a CA Harvest SCM Project.
This is a
mandatory
parameter.
Method
PUT
Request Body Parameter
At a time, only one of the parameters (
versionIds
or
packageId
) can be given. packageId lets you delete all versions in a package and versionIds lets you delete a specific version at a package level.
versionIds
Unique ID to specify a version that needs to be deleted at a package level.
This is a
mandatory
parameter.
packageId [integer]
Unique ID that represents a CA Harvest SCM package to delete all versions at a package level.
This is a
mandatory
parameter.
Example Use Case:
The following example sample model showcases deleting a specific version at a package level: 
Sample Request
{ "versionIds": [10] }
Sample Response
Status: 200 (OK)
{ "status": "success", "message": "I0002001d: Version 1 of DEFN.H deleted.\nI00020019: The Delete Versions execution was successful." }
Status: 422 (Unprocessable Entity)
{ "timestamp": "2020-11-27T11:36:54.928+0000", "status": 422, "errors": [ "E03020072: Version id 22222 does not exist" ], "path": "/harvest-scm/rest/projects/86/states/347/packages/529/versions/22222" }
Checkout For Browse
This API is supported and available in CA Harvest SCM 14.0.1.
This API is used to execute checkout for browse from a REST client. API returns a file in a zip format with the project name. For example:
projectname.zip
file. This file contains all the items that needs to be checked out.
Checkout Parameters
  1. Mode
    :
    Checkout mode is set to "
    Browse
    " always.
    "synchronize"
    is not supported for REST API. 
  2. Checkout Option
    :
    Supported ways to check out to client path are as follows:
    1. Preserve and Create Directory Structure
      : It checks out and returns all the selected items in a zip or compressed file. For example: EMS.zip, where EMS is Harvest project name. This option places all selected items in the same hierarchy as the harvest repository structure.
      Preserve and Create Directory Structure is the default value.
    2. All Files to the Same Client Directory
      : This option places all the selected items directly under a folder that has project name and compress it to a zip file name for example,
      EMS.zip
      .
URL
https://<host>:<port>/harvest-scm/rest/projects/<projectId>/states/<stateId>/processes/<processId>/execute
Method
PUT
Request Body Parameter
packageId
Provide package Id to include versions from trunk and branch. If packageId and includePackageVersions is set to
true
, then it will consider both branch versions and trunk version.
from
Specify a view path in the repository from which items are checked out.
This is a mandatory parameter.
versionIds
Provide the id of the versions that you have selected for checkout. If you do not select any version, complete view path will be checked out.
snapshotViewId
Specifies a snapshot from which versions can be selected for checkout. This field is applicable only when a snapshot exists in the view in which you are executing the checkout process.
recursive
Provide the value as
true
, if you want to check out all versions in the selected folders and subfolders in the Versions list. Default value is
true
. Provide the value as
false
if you do not want to checkout folders and subfolders in the version list.
includePackageVersions
Selects the latest versions from the trunk and branch that are associated with a given package.
You must provide the
packageId
for this parameter. The default value is
false
. It is applicable only if packageId is provided.
Example Use Case:
Checkout For Browse package sample example request and responses:
Sample Request
{ "packageId": "15", "from": "\\", "option": "All Files to the Same Client Directory", "includePackageVersions": false, "versionIds": [], "recursive": true, "snapshotViewId": 5 }
Sample Response
Status: 200 (OK)
It returns a ZIP or compressed file.
Status: 422 (Unprocessable Entity)
{ "timestamp": "2020-12-07T11:04:42.714+0000", "status": 422, "errors": [ "E03020151: Invalid view path : \\cbrepos.\n" ], "path": "/harvest-scm/rest/projects/20/states/83/processes/604/execute" }
Swagger Sample Model for Process Execute API
none
{ "swagger": "2.0", "info": { "description": "Api Documentation", "version": "1.0", "title": "Api Documentation", "termsOfService": "urn:tos", "contact": {}, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, "host": "localhost:8080", "basePath": "/harvest-scm", "tags": [ { "name": "Process Execute API" } ], "paths": { "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute": { "put": { "tags": [ "Process Execute API" ], "summary": "Create Package", "operationId": "excuteUsingPUT", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "createPackageRequest", "description": "createPackage", "required": true, "schema": { "$ref": "#/definitions/CreatePackageExecuteRequest" } }, { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/CreatePackageResponse" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/createPackageObjError" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Delete Package", "operationId": "excuteUsingPUT_1", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "deletePackageRequest", "description": "deletePackageRequest", "required": true, "schema": { "$ref": "#/definitions/DeletePackageExecuteRequest" } }, { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DeletePackageExecuteResponse" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "422": { "description": "Bad Request.", "schema": { "$ref": "#/definitions/DeletePackageObjError404" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Approve Package", "operationId": "excuteUsingPUT_2", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "approvePackageRequest", "description": "approvePackageRequest", "required": true, "schema": { "$ref": "#/definitions/ApprovePackageExecuteRequest" } }, { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/ApprovePackageExecuteResponse" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/ApprovePackageExecuteResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Promote Package", "operationId": "excuteUsingPUT_3", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "promotePackageRequest", "description": "promotePackageRequest", "required": true, "schema": { "$ref": "#/definitions/PromotePackageExecuteRequest" } }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/PromotePackageExecuteResponse" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/PromotePackageExecuteResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Demote Package", "operationId": "excuteUsingPUT_4", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "demotPackageRequest", "description": "demotPackageRequest", "required": true, "schema": { "$ref": "#/definitions/PromotePackageExecuteRequest" } }, { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DeomotePackageExecuteResponse" } }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/DemotePackageExecuteResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Switch Package", "operationId": "excuteUsingPUT_5", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "switchPackageRequest", "description": "switchPackageRequest", "required": true, "schema": { "$ref": "#/definitions/SwitchPackageExecuteRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/SwitchPackageExecuteResponse" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/SwitchPackageExecuteResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "UDP Process", "operationId": "excuteUsingPUT_6", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "udpExecuteRequest", "description": "udpExecuteRequest", "required": true, "schema": { "$ref": "#/definitions/UdpExecuteRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/UDPExecuteResponse" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/UDPExecuteResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Delete Versions", "description": "The delete version process when executed at package level lets you delete all versions in a package. VersionIds can be provided to delete a specific set of versions. Refer to 'Using Packages' section in documentation.", "operationId": "deleteVersions_6", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "DeleteVersionsExecuteRequest", "description": "DeleteVersionsExecuteRequest", "required": true, "schema": { "$ref": "#/definitions/DeleteVersionsExecuteRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/DeleteVersionsExecuteResponse" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/DeleteVersionsResponseError422" } } }, "deprecated": false } }, "/rest/projects/{projectId}/states/{stateId}/processes/{processId}/execute ": { "put": { "tags": [ "Process Execute API" ], "summary": "Checkout For Browse", "externalDocs": { "description": "Checkout Process", "url": "https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/harvest-scm/14-0/using/use-check-in-and-check-out-in-ca-harvest-scm.html#concept.dita_1a505aea655868d0a8e6ad8ce5c5e02b48639fd4_CheckOutProcess" }, "description": "This API is used to execute checkout for browse from a REST client. API returns a file in a zip or compressed format with the project name. For example: EMS.zip file that contains all the items that you want to checkout. <br><b>Checkout Parameters</b> <li>Mode <br> Checkout mode is set to \"Browse\"</br></br> always. <b>Note:</b>\"synchronize\" is not supported from REST API</br></br> <li> Checkout Option </br> Supported ways to check out to client path are <ol><li>Preserve and Create Directory Structure</li> <li>All Files to the Same Client Directory</li> </ol>\n<ol><b>Preserve and Create Directory Structure</b></ol>It checks out and returns all selected items in a zip formatted file named like EMS.zip.\nPlaces all selected items in the same hierarchy as the harvest repository structure\n<ol><b>All Files to the Same Client Directory</b></ol> Places all selected items directly under a folder that has project name and returns a compressed or zip file, for example, EMS.zip</br>\n<b>Note:</b> Preserve and Create Directory Structure is the default value <br><br> <li>from</li> Specify a view path in the repository from which items are checked out <br><br> <li>versionIds</li> Provide the id of the versions that you have selected to checkout.<br><br> <li>snapshotViewId</li> Specifies a snapshot from which you can select versions to checkout. This field is applicable only when a snapshot exists in the view on which you are executing the checkout process.<br><br> <li>recursive</li> Provide true, if you want to check out all versions in the selected folders and subfolders in the Versions list. Default value is true and you can provide false if you don't want to checkout folders and subfolders in the version list.<br><br> <li>includePackageVersions</li> Selects the latest versions from the trunk and branch that are associated with a given package. The default value is false. This property is applicable only if packageId is provided. <br><br> <li>packageId</li> You must provide the packageId to include versions from trunk and branch.", "operationId": "checkoutForBrowse_6", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "projectId", "in": "path", "description": "projectId", "required": true, "type": "integer", "format": "int64" }, { "name": "stateId", "in": "path", "description": "stateId", "required": true, "type": "integer", "format": "int64" }, { "name": "processId", "in": "path", "description": "processId", "required": true, "type": "integer", "format": "int64" }, { "in": "body", "name": "CheckoutBrowseProcessExecuteRequest", "description": "CheckoutBrowseProcessExecuteRequest", "required": true, "schema": { "$ref": "#/definitions/CheckoutBrowseProcessExecuteRequest" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "file" } }, "422": { "description": "Unprocessable entity", "schema": { "$ref": "#/definitions/CheckoutForBrowseResponseError422" } } }, "deprecated": false } } }, "definitions": { "ApprovePackageExecuteRequest": { "type": "object", "properties": { "approve": { "type": "boolean", "description": "Array of Harvest Package/PackageGroup Ids. It is a mandatory field" }, "comment": { "type": "string", "description": "Comments If any" }, "packageGroupIds": { "type": "array", "items": { "type": "integer", "format": "int64", "description": "Array of Harvest PackageGroup Ids." } }, "packageIds": { "type": "array", "items": { "type": "integer", "format": "int64", "description": "Array of Harvest Package Ids." } } }, "example": { "packageIds": [ 401, 402 ], "approve": "true" }, "title": "ApprovePackageExecuteRequest" }, "CreatePackageExecuteRequest": { "type": "object", "properties": { "assignedTo": { "type": "integer", "format": "int64" }, "description": { "type": "string" }, "name": { "type": "string" }, "note": { "type": "string" }, "processId": { "type": "integer", "format": "int64" }, "projectId": { "type": "integer", "format": "int64" }, "stateId": { "type": "integer", "format": "int64" } }, "title": "CreatePackageExecuteRequest", "example": { "assignedTo": 12, "description": "Creating a new package", "name": "CA Harvest SM Git UI", "note": "new feature in V14", "processId": 600, "projectId": 14, "stateId": 55 } }, "DeletePackageExecuteRequest": { "type": "object", "properties": { "packageId": { "type": "integer", "format": "int64" } }, "title": "DeletePackageExecuteRequest", "example": { "packageId": 253 } }, "DemotePackageExecuteHandler": { "type": "object", "properties": { "processExecuteDetails": { "$ref": "#/definitions/ProcessExecuteRequest" } }, "title": "DemotePackageExecuteHandler" }, "ProcessExecuteRequest": { "type": "object", "properties": { "description": { "type": "string" }, "name": { "type": "string" }, "note": { "type": "string" }, "processId": { "type": "integer", "format": "int64" }, "projectId": { "type": "integer", "format": "int64" }, "stateId": { "type": "integer", "format": "int64" } }, "title": "ProcessExecuteRequest" }, "CreatePackageResponse": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string" } }, "example": { "status": "success", "message": "I000206ad: Created package Enable Smart Card Authentication." }, "title": "CreatePackageResponse" }, "createPackageError": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2019-11-20T03:19:04.019+0000", "status": 400, "errors": [ "E03020005: The package name, Api Package, has already been used in this project." ], "path": "/harvest-scm/rest/projects/101/states/101/packages" } }, "DeletePackageExecuteResponse": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string" } }, "example": { "status": "success", "message": "I00020060: Deleted package myPack.\nI00020019: The Delete Package Process execution was successful." }, "title": "DeletePackageExecuteResponse" }, "DeletePackageObjError404": { "title": "DeletePackageObjError404", "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T01:36:28.103+0000", "status": 422, "errors": [ "ER1000422: Package id 2 does not exist in the State id 55" ], "path": "/harvest-scm/rest/projects/13/states/55/processes/383/execute" } }, "ProcessOperationsResponse": { "type": "object", "properties": { "message": { "type": "string" }, "status": { "type": "string" } }, "title": "ProcessOperationsResponse" }, "PromotePackageExecuteRequest": { "type": "object", "properties": { "addDependentPkgs": { "type": "boolean" }, "approve": { "type": "boolean" }, "enforcePkgBind": { "type": "boolean" }, "enforcePkgMerge": { "type": "boolean" }, "packageGroupIds": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "packageIds": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "verifyPkgDependency": { "type": "boolean" } }, "example": { "addDependentPkgs": true, "approve": true, "enforcePkgBind": true, "enforcePkgMerge": true, "packageIds": [ 4 ], "verifyPkgDependency": true }, "title": "PromotePackageExecuteRequest" }, "SwitchPackageExecuteRequest": { "type": "object", "properties": { "sourcePackageId": { "type": "integer", "format": "int64" }, "targetPackageId": { "type": "integer", "format": "int64" }, "versionIds": { "type": "array", "items": { "type": "integer", "format": "int64" } } }, "example": { "status": "success", "message": "I0002003f: The 2 versions have been transferred from the source package MR- 000003 to the target package MR- 000002.\nI00020019: The Switch Package Process execution was successful." }, "title": "SwitchPackageExecuteRequest" }, "UdpExecuteRequest": { "type": "object", "properties": { "addtionalCmdParams": { "type": "string" }, "packageIds": { "type": "array", "items": { "type": "integer", "format": "int64" } }, "versionIds": { "type": "array", "items": { "type": "integer", "format": "int64" } } }, "title": "UdpExecuteRequest", "example": { "packageIds": [ 4, 5 ], "versionIds": [ 220, 221 ] } }, "DeleteVersionsExecuteRequest": { "type": "object", "properties": { "packageId": { "type": "string" }, "versionIds": { "type": "array", "items": { "type": "integer", "format": "int64", "description": "Specific version ids to be deleted." } } }, "title": "DeleteVersionExecuteRequest", "example": { "packageId": 511 } }, "createPackageObjError": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2019-11-20T03:19:04.019+0000", "status": 400, "errors": [ "E03020005: The package name, API Package is used in this project." ], "path": "/harvest-scm/rest/projects/101/states/101/packages" } }, "ApprovePackageExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "AZ: The approve process was successful for package: MR- 000002. Package is not frozen." } }, "ApprovePackageExecuteResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T02:46:00.495+0000", "status": 422, "errors": [ "ER1000422: Invalid Package Ids: [123, 456]" ], "path": "/harvest-scm/rest/projects/13/states/55/processes/410/execute" } }, "PromotePackageExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "I00020017: The package MR- 000002 has been promoted to Test.\nI00020015: The process execution completed successfully. The package count is: 1.\nE03020178: No email addresses found for the notify process." } }, "PromotePackageExecuteResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T02:46:00.495+0000", "status": 422, "errors": [ "ER1000422: Invalid Package Ids: [123, 456]" ], "path": "/harvest-scm/rest/projects/13/states/55/processes/410/execute" } }, "DeomotePackageExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "I00020018: The package MR- 000002 has been demoted to Development.\nI00020015: The process execution completed successfully. The package count is: 1.\nE03020178: No email addresses found for the notify process." } }, "DemotePackageExecuteResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T02:46:00.495+0000", "status": 422, "errors": [ "ER1000422: Invalid Package Ids: [123, 456]" ], "path": "/harvest-scm/rest/projects/13/states/55/processes/410/execute" } }, "SwitchPackageExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "I0002003f: The 2 versions have been transferred from the source package MR- 000003 to the target package MR- 000002.\nI00020019: The Switch Package Process execution was successful." } }, "SwitchPackageExecuteResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T05:13:57.307+0000", "status": 422, "errors": [ "E03020072: Package ids 51, 41 do not exist" ], "path": "/harvest-scm/rest/projects/13/states/55/processes/397/execute" } }, "UDPExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "I00020133: Jenkins Build Triggered Successfully" } }, "DeleteVersionsExecuteResponse": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "example": { "status": "success", "message": "I00020020: The Delete Versions execution was successful. All versions in the package are deleted." } }, "UDPExecuteResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-10-09T06:21:53.367+0000", "status": 422, "errors": [ "E03020132: Could not find UDP program: notepad1." ], "path": "/harvest-scm/rest/projects/13/states/55/processes/411/execute" } }, "DeleteVersionsResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-11-27T11:36:26.417+0000", "status": 422, "errors": [ "ER1000422: Provide either packageId or versionIds. Provide packageId to delete all versions in the package else provide versionIds to delete specific versions." ], "path": "/harvest-scm/rest/projects/85/states/343/processes/2834/execute" } }, "CheckoutBrowseProcessExecuteRequest": { "type": "object", "properties": { "description": { "type": "string" }, "from": { "type": "string" }, "includePackageVersions": { "type": "boolean" }, "option": { "type": "string" }, "packageId": { "type": "integer", "format": "int64" }, "projectId": { "type": "integer", "format": "int64" }, "stateId": { "type": "integer", "format": "int64" }, "recursive": { "type": "boolean" }, "snapshotViewId": { "type": "integer", "format": "int64" }, "versionIds": { "type": "array", "items": { "type": "integer", "format": "int64" } } }, "example": { "packageId": "15", "from": "\\", "option": "All Files to the Same Client Directory", "includePackageVersions": false, "versionIds": [], "recursive": true, "snapshotViewId": 5 }, "title": "CheckoutBrowseProcessExecuteRequest" }, "CheckoutForBrowseResponseError422": { "type": "object", "properties": { "timestamp": { "type": "string" }, "status": { "type": "integer" }, "errors": { "type": "array", "items": { "type": "string" } }, "path": { "type": "string" } }, "example": { "timestamp": "2020-12-07T11:04:42.714+0000", "status": 422, "errors": [ "E03020151: Invalid view path : \\cbrepos.\n" ], "path": "/harvest-scm/rest/projects/20/states/83/processes/604/execute" } } } }