Update an External SCM Repository Item
This page describes the process of updating external SCM repository items via Swagger.
Introduction
A new endpoint is available to update an existing, external SCM repository items via Swagger:
PUT/v3/trackers/projects/{projectId}/repository/{repositoryId}
Usage
To update and external SCM repository item,
- Use the PUT/v3/trackers/projects/{projectId}/repository/{repositoryId} endpoint in Swagger.
- Add the Codebeamer project ID to the projectId field.
- Add the Codebeamer repository ID to the repositoryId field.
- Provide the relevant details in the Request body.
Example:
{
"accessTokenId": 6326,
"accessTokenName": "token_Test1",
"accessTokenValue": "8C-2W-5Z-1P-7F",
"enablePatchSynchronization": true,
"name": "TestRepository",
"ownerName": "CBTest",
"projectName": "CB-Test-Project",
"remoteApiUrl": "https://dev.azure.com",
"repositoryName": "TestAzure",
"scmType": "azurerepo",
"secretId": 1
}
- Click Execute.
By clicking Execute, the existing external SCM repository for which the details are provided in the Request body is updated 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 an existing external SCM repository was updated on the user interface.
Parameter |
Description |
"accesstokenId"
|
The new access token to use instead of the current one must already exist in Codebeamer to be able to update an existing, 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 needs to be updated to 5548 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 relevant Codebeamer access token tracker item to which the old value should be updated.
For example: Update the value token_Test to token_Test1. |
"accessTokenValue"
|
The access token generated in GitHub or Azure.
For example: 8C-2W-5Z-1P-7F...
|
"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.
|