Project Deployment via Swagger API
This page provides a guide for exporting and importing Codebeamer projects using Swagger API.
Prerequisites
• Refer to the
Prerequisites section on the main Project Configuration Deployment page.
Exporting Projects for Deployment Using Swagger API
To export projects for deployment using Swagger API:
1. Use the POST/v3/deployment/export endpoint in Swagger.
2. Add the "projectSettings" details to the Request body field. For details, refer to the following example:
{
"projectSettings": [
{
"projectId": "1607",
"includeQueries": true,
"trackers": [
{
"trackerId": "3914582",
"itemsIncluded": true
},
{
"trackerId": "3914583",
"itemsIncluded": true
},
{
"trackerId": "3914584",
"itemsIncluded": false
},
{
"trackerId": "3914585",
"itemsIncluded": false
},
{
"trackerId": "3914586",
"itemsIncluded": true
},
{
"trackerId": "3914587",
"itemsIncluded": false
},
{
"trackerId": "3914588",
"itemsIncluded": false
},
{
"trackerId": "3914589",
"itemsIncluded": false
},
{
"trackerId": "3914590",
"itemsIncluded": false
},
{
"trackerId": "3914591",
"itemsIncluded": false
},
{
"trackerId": "3914592",
"itemsIncluded": false
},
{
"trackerId": "3914593",
"itemsIncluded": true
},
{
"trackerId": "3914594",
"itemsIncluded": true
},
{
"trackerId": "3914595",
"itemsIncluded": false
},
{
"trackerId": "3914596",
"itemsIncluded": false
}
]
}
],
"password": "",
"exportFileName": "Swagger_deployment_test"
}
3. Click Execute.
In the Server response section, Code 200 indicates that the export job is scheduled successfully. The Response body contains the "jobId", which is the ID of the deployment export background job.
4. Copy the value of the "jobId" and add it to the jobId field of the GET/v3/job/{jobId} background job endpoint.
5. Click Execute.
6. In the Server response section, the Response body of Code 200 displays the download link for the exported project as the value of the "resultMessage". To download the exported project, copy the download link and paste it into the address bar of a browser.
Exporting projects for deployment using Swagger API produces the same results as performing it from the user interface.
Applying Projects Deployment via Swagger API
You can import the projects previously exported for deployment back to Codebeamer.
To apply projects for deployment using Swagger API:
1. Use the POST/v3/deployment endpoint in Swagger.
2. In the Request body section, select the deployment file to import. Based on your deployment-related settings in the application configuration, set the values of the importTrackerHierarchy and skipRefreshComputedFields to true or false if necessary.
3. Click Execute.
In the Server response section, Code 200 indicates that the deployment import is successful. The Response body contains the "jobId", which is the ID of the deployment import background job.
4. Copy the value of the "jobId" and add it to the jobId field of the GET/v3/job/{jobId} background job endpoint.
5. Click Execute.
6. In the Server response section, the Response body displays the details of the successful deployment import process.
Exporting projects for deployment using Swagger API produces the same results as performing it from the user interface.