You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Create an External SCM Repository Item

This page describes the creation of external SCM repository items via Swagger.

Introduction

A new endpoint is available to create external SCM repository items via Swagger:

POST/v3/trackers/projects/{projectId}/repository

Usage

To create an external SCM repository item,

  1. Use the POST/v3/trackers/projects/{projectId}/repository endpoint in Swagger.
  2. Add the Codebeamer project ID to the projectId field.
  3. Provide the relevant details in the Request body.
    Example:
    {
      "accessTokenId": 6326,
      "accessTokenName": "token_Test",
      "accessTokenValue": "test453-124fb4tb",
      "enablePatchSynchronization": true,
      "name": "TestRepository",
      "ownerName": "CBTest",
      "projectName": "CB-Test-Project",
      "remoteApiUrl": "https://dev.azure.com",
      "repositoryName": "TestAzure",
      "scmType": "azurerepo",
      "secretId": 2
    }
    
  4. Click Execute.

By clicking Execute, the new external SCM repository is created if all the details are provided correctly.

If the Request body contains any incorrect values, the API request fails.

Parameters of the Request Body


The following details need to be provided in the Request body. The same parameters must be provided in the Request body as if a new external SCM repository was created on the user interface.

Parameter Description
"accesstokenId"

The access token must already exist in Codebeamer to be able to create a new external SCM repository via Swagger.
The access token must be created on the User Interface as a Codebeamer tracker item the ID of which is the access token ID.
For example, the item ID of the token_Test tracker item is 6326 which must be provided in Swagger as the value for the "accessTokenId" parameter.

"accessTokenName"

The "accessTokenName" is the content of the Summary field of the Codebeamer access token tracker item.

For example: token_Test.

"accessTokenValue"

The access token generated in GitHub or Azure.
For example: 3D-5C-7Q-2T-9E...

"enablePatchSynchronization"

Whether commit patch synchronization is required or not.
Boolean, for example: true.

"name"

An arbitrary name for the repository.

"ownerName"

This is the equivalent of the Owner/Organization name field on the User Interface.

In case of Azure, this is the organization name.
In case of GitHub, this is the name of the GitHub user who owns the repository.

"projectName"

The name of the Azure project.

"remoteApiUrl"

The base API URL of the provider.
For example: https://dev.azure.com.

"repositoryName"

The actual name of the repository within GitHub or Azure.
For example: TestAzure.

"scmType"

The provider.
For example: github or azurerepo.

"secretId"

The secrets are needed for the webhooks.
The DEFAULT - NONE secret value is added to each repository by default.
Custom secrets can also be created.

The value must be the sequential number of the line in which a secret is listed in the Codebeamer SCM Secret tracker.

For example:

In the SCM Secret Tracker,
The [SCM_SECRET-6726] mysecret tracker item is listed as the first item.
The [SCM_SECRET-6325] DEFAULT - NONE is listed as the second item.
To use the [SCM_SECRET]mysecret, the "secretId" must be 1.

The request fails if the value remains 0.