Jenkins is an open source automation server that can act as a continuous integration (CI) server or a continuous delivery (CD) hub. With hundreds of available plug-ins, teams can use Jenkins to build, deploy, and automate almost any project.
To set up a Jenkins integration for your API, first create an API token in Jenkins and then configure your API in Postman. After you set up the integration, you can view the status of builds or start a new build, all from within Postman.
Open your API by selecting APIs in the sidebar. Each API can be linked to one CI project.
Select Test and Automation.
Under Automate, select Jenkins.
Enter a Nickname to help you recognize the integration later.
Enter the URL of your Jenkins server.
If your Jenkins server is located behind a firewall, you may need to ask your IT team to allowlist the Postman static IP address (
3.212.102.200
) to enable the Jenkins integration. Learn more about Static IP support.
Enter your Jenkins username.
For Authentication token, enter your Jenkins API token.
Select the CI project used for your API.
Select Connect.
After you set up a Jenkins integration, information for build jobs is available in Postman. For each build you can view the start time, duration, and build status (Success
or Failed
). You can also view the results of collection runs that are configured in your pipeline using the Postman CLI.
To view build jobs, open an API and select Test and Automation. The most recent jobs are listed under the repository name.
Select View Builds to view the full list of build jobs. From here you can take the following actions:
Using the Postman CLI, you can run Postman collections with your API tests as part of a Jenkins pipeline.
To view details for collections that were run as part of a build, first configure the Postman CLI for Jenkins and then start a new build. After the build is complete, use the arrows to expand a build and expand a collection to view details about a collection run.
Select View Report to view a collection run report in the Postman History. Learn more about using the Collection Runner.
Using the Postman CLI, you can enforce Postman API Governance and API Security rules each time the pipeline runs using the api lint command (Enterprise teams only).
To view the results of API Governance and API Security checks that ran as part of the build, first configure the Postman CLI for Jenkins and then start a new build. After the build is complete, use the arrows to expand a build and expand an API definition to view any rule violations.
With the help of the Postman CLI and the Postman API, you can run Postman collections with your API tests as part of your Jenkins pipeline. First generate the Postman CLI configuration code in Postman. Then add the configuration code to your Jenkins pipeline.
Each time a build runs, the Postman CLI runs the collections that contain your tests. You can view the results of your tests in Postman. You can also enforce API Governance and API Security rules each time the pipeline runs (Enterprise teams only).
Before you begin, make sure you've already set up an integration between your API and Jenkins.
To generate configuration code for the Postman CLI, do the following:
To add the Postman CLI configuration to your Jenkins pipeline, do the following:
Open your pipeline project in Jenkins and select Configure.
Paste the Postman CLI configuration you copied from Postman into the Pipeline script. Then, do the following:
your_nodejs_configured_tool_name
with the name of your Node.js tool, for example, node
.$POSTMAN_API_KEY
with a valid Postman API Key.Select Save and then run the pipeline using the new configuration.
To view the test results in Postman, open your API and select Test and Automation. For more help, see Viewing collection run details.
Last modified: 2024/07/02
Additional resources
Videos
Blog posts