Use Jenkins with Automation
This article refers to features that are currently rolling out. To find out when these features will be live on your site, keep an eye on our release notes or the Atlassian Community.
The Datadog integration with Automation is only available to Jira Service Management Cloud customers on Premium or Enterprise plans. Find out how to upgrade your plan.
You can connect your Jenkins account with your project to automate the process of managing the code delivery process.
To use these actions, you need to connect the Jenkins app to Atlassian Automation. For most of the automation actions, you’ll get a connection setup message when you select them. Once the connection is established, you can automate actions and set up triggers based on Jenkins events.
Before you begin
To manage project automations, you must have the appropriate project permissions:
Company-managed projects: You’ll need the Administer projects and Browse projects permissions for your project. Learn more about permissions for company-managed projects
Team-managed projects: You’ll need Administrator access for your project. Learn more about permissions for team-managed projects
To manage global automations, you’ll need the Administer Jira permission. Learn more about global permissions in Jira Cloud.
Integrate your automation rule with Jenkins
Go to Automation and select Create rule.
Select the Jenkins action for your rule.
Select Connect to create a connection with Jenkins. Connections allow your automation rules to fetch data from other tools and products.
Enter the required information to create your connection with Jenkins:
Connection name: Enter the name of the Datadog connection.
Username: Enter your Jenkins username.
API token: Enter your API key from Jenkins to connect it with Atlassian Automation.
Domain URL: Enter the base URL for Jenkins.
5. Select Connect to complete creating your connection.
Actions
Get Jenkins system information
You can use this action to retrieve system health, jobs, and status, including key details about your Jenkins instance.
Smart value
{{fetchedJenkinsInfo}}
– Returns the Jenkins system information.
Get Jenkins job details
You can use this action to get details for a Jenkins job, including build history, health, and configuration.
Enter the following fields or select using smart values:
Job name: Enter the name of the Jenkins job you want to get details for.
JSON filter: Enter a JSON filter to specify which job details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsJob}}
– Returns Jenkins job.
Trigger Jenkins build
You can use this action to start a new build for a Jenkins job and queue the job using its default configuration.
Enter the following field or select using smart values:
Job name: Enter the name of the Jenkins job you want to build.
Smart value
{{fetchedJenkinsBuild}}
– Returns Jenkins build.
Trigger Jenkins build with parameters
You can use this action to start a build with custom parameters, allowing you to run a parameterized job with specific values.
Enter the following fields or select using smart values:
Job name: Enter the name of the Jenkins job you want to build.
Parameter 1: Enter the name of the first parameter.
Parameter 1 value: Enter the value for the first parameter.
Parameter 2: Enter the name of the second parameter.
Parameter 2 value: Enter the value for the second parameter.
Parameter 3: Enter the name of the third parameter.
Parameter 3 value: Enter the value for the third parameter.
More parameters: Add more parameters as needed in JSON format.
Smart value
{{fetchedJenkinsBuild}}
– Returns Jenkins build.
Get Jenkins latest build information
You can use this action to get information about the latest build for a Jenkins job, including status, duration, and results.
Enter the following fields or select using smart values:
Job name: Enter the name of the Jenkins job you want to check.
JSON filter: Enter a JSON filter to specify which build details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsBuild}}
– Returns Jenkins build.
Get Jenkins build queue
You can use this action to get the current Jenkins build queue and check pending builds and system load.
Enter the following fields or select using smart values:
JSON filter: Enter a JSON filter to specify which queue details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsBuild}}
– Returns Jenkins build.
Get Jenkins build information
You can use this action to get details for a specific Jenkins build, including logs, artifacts, and execution details.
Enter the following fields or select using smart values:
Job name: Enter the name of the Jenkins job.
Build ID: Enter the ID of the build you want to get information for.
JSON filter: Enter a JSON filter to specify which build details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsBuild}}
– Returns Jenkins build.
Get Jenkins all jobs
Get a list of all Jenkins jobs with their names and status colors.
Enter the following fields or select using smart values:
JSON filter: Enter a JSON filter to specify which queue details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsJobList}}
– Returns Jenkins job list.
Get Jenkins user details
Get details about a specific Jenkins user including user properties, permissions, and account details.
Enter the following fields or select using smart values:
Username: Enter the name of the user.
JSON filter: Enter a JSON filter to specify which queue details to retrieve. For example:
jobs[name,color]
.Detail level: Select the level of detail to include. Higher levels will include more nested data.
Smart value
{{fetchedJenkinsUser}}
– Returns Jenkins user details.
Was this helpful?