Skip to main content

Branching a Project

The API client can create a branch for an existing project.

To create a new project, first run a scan with a new project name, and then branch the existing project as described here.

CxSDKWebService.BranchProjectById Method

public CxWSResponseRunID BranchProjectById(
        string sessionId, 
        long originProjectId, 
        string newBranchProjectName
);

Parameters

  • sessionId: The current Session ID

  • originProjectId: The original Project ID of the project to be branched. Can be obtained from the server response upon running a scan.

  • newBranchProjectName:New Project Name for the branch.

Return Value

CxWSResponseRunID, including:

If there are any errors, the return value parameter “CxWSResponseRunID.IsSuccesfull” is set to false and the second parameter “CxWSResponseRunID.ErrorMessage” indicates the reason for failure.

Example

To branch an existing project with a known ID of 200:

Visual Studio Example

internal void Main(string [] args)
{
   String sessionID = args[0];
   CxSDKWebServiceSoapClient cxSDKProxy = new CxSDKWebServiceSoapClient();
  
   //The project unique ID
   long projectID = 200;
  
   CxWSResponseRunID response= cxSDKProxy.BranchProjectById(sessionID, projectID,"NewProjectName");
  
   //project configuration Id
   Long projectId = response.ProjectID;
}

SOAP to REST Mapping

This section covers SOAP to REST migration and mapping of our legacy SOAP based SDK to the new REST APIs. It is recommended to use this reference only once CxSAST V8.8.0 is installed.

BranchProjectById

POST /projects/{id}/branch

Create a specific project’s branch. Parameters include - name.

For more mapping information, refer to API Mapping (SOAP to REST). You can also find a summary of our REST APIs here.

9.5 Branching Enhancements