Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,455,528
Community Members
 
Community Events
175
Community Groups

Jenkins integration with Jira simplified

If you are a Jira admin and your teams are using both Jenkins and Jira, we’re happy to announce that your life has just become a bit simpler 🙂.

In March, we have released the new and free Jenkins for Jira app on the Jira Marketplace, making it easier to connect your Jenkins servers with your Jira projects than it was before. Read on to find out what has changed and how it can help your team.

Why should I connect my Jenkins pipelines to Jira?

If you haven’t connected your Jenkins pipelines to your Jira site before, you might wonder what value this connection provides. In a nutshell, it’s to increase the visibility of your builds and deployments so that your team has complete visibility of your builds and deployments in Jira. For example, they can see which build might be failing or which Jira issue has been deployed to which environment.

Once connected, every time a build pipeline is triggered, Jenkins will send information about the status of this build to Jira. Jira will then show the builds in the “Development” section of the issue view:

image.png

If the build pipeline also contains a step that deploys your software to a runtime environment, Jenkins will additionally send information about this deployment to Jira. You can see in the “Releases” section of the screenshot above that the change made for this specific Jira issue has been successfully deployed to a production environment.

How does Jenkins know which Jira issue a build or deployment to associate to? A Jenkins pipeline is usually triggered by a commit pushed to a Git repository. Jenkins looks for Jira issue keys like “PROJ-1” in the all the commit messages since the last time the pipeline has run. If it finds any, it will add the build and deployment information to those issues in Jira.

But seeing the builds and deployments in the issue view is not all! Jira also shows your deployments on a timeline:

image.png

This gives the whole team (including non-developers) a nice overview of which features have been deployed into staging and/or production already. QA engineers will know which features can be tested where and product managers will know which features are already live. You can read more about deployments in Jira here.

There are some other nice features Jira provides when it gets deployment information from your Jenkins server (or other CI/CD tool), like a cycle time report or a deployment frequency report. Also, you can use the events “Deployment successful”, “Deployment failed”, and “Deployment status failed” in automation rules to automatically trigger some actions in Jira. Powerful stuff!

Connecting with the “Jenkins for Jira” app

If you have connected a Jenkins server with Jira before, you might have used Jira’s OAuth feature and version 1.x of the Atlassian Jira Software Cloud Plugin.

The user experience was a bit bumpy, though. As a Jira admin, you might have searched for “Jenkins” in the Jira Marketplace, found the “Jenkins for Jira” app, only to realize that this wasn’t a real app but instead it would just point you to a wall of text explaining how to set everything up. You would have to:

  • work through the docs to understand everything,

  • install the Jenkins plugin,

  • create OAuth credentials in Jira,

  • paste them into the Jenkins plugin,

  • and finally modify your Jenkinsfiles to add specific build steps that would send build and deployment information to Jira.

With the new “Jenkins for Jira” app we want to make this experience much simpler.

Installing the app

Instead of just redirecting to the docs, the Marketplace listing is now a real app that you can install into your Jira site.

After installing the app, when you navigate to the “Manage apps” page, you now get an entry in the navigation:

image.png

Installing the Jenkins plugin

This link leads you to the new app within Jira, which leads you through the process of setting everything up without you having to read through a long page of docs:

image.png

 

You still need to install the Jenkins plugin (the most recent version 2.x!), but we hope that it’s much clearer now how to do it!

Registering your Jenkins server

Then, you register your Jenkins server and get a webhook URL and secret in return:

 image.png

Configuring the Jenkins plugin

You then copy the webhook URL and secret into the configuration of the Jenkins plugin that you have installed to your Jenkins server:

image.png

Currently, you still have to do this copy & pasting manually, but we’re looking into ways to automate this step in the future.

Profit!

Finally, and this is a great improvement to before, you don’t have to modify your Jenkinsfiles to have Jenkins send builds and deployments to Jira anymore!

With the previous version of the Jenkins plugin, you would have to add steps like these to your Jenkinsfile:

post {
  always {
    jiraSendBuildInfo site: 'example.atlassian.net', branch: 'TEST-123-awesome-feature'
  }
}
post {
  always {
    jiraSendDeploymentInfo environmentId: 'us-prod-1', environmentName: 'us-prod-1', environmentType: 'production'
  }
}

With version 2.x, the Jenkins plugin will now automatically send build information to Jira. It will also automatically send deployment information to Jira if your build steps are named according to the convention “deploy to <environment_name>”:

stage('deploy to prod') {
  steps {
    echo 'Deploying...'
  }
}

You can change the naming convention by providing a regular expression in the configuration settings of the Jenkins plugin:

image.png

Let us know how it goes

While the old way of connecting via OAuth credentials is still working (with version <= 1.4.5 of the Jenkins plugin and OAuth credentials created in Jira), we invite you to try out the new Jenkins for Jira app.

We hope that this makes the experience of integrating Jenkins with Jira much smoother than it has been.

Where can we improve it? What is missing? Any questions? Let us know.

Get started with our support docs.

5 comments

Tuncay Senturk Community Leader Apr 07, 2022

Thanks @Tom Hombergs 

Like • Tom Hombergs likes this
Muhammet Ayal Community Leader Apr 08, 2022

Thank you for sharing. @Tom Hombergs 

Like • Tom Hombergs likes this

Anybody who knows if this app is going to be available for Data Center as well?

Tom Hombergs Atlassian Team Jun 01, 2022

@Lotta Löfwall there are currently no plans to make it available for Data Center.

Not sure if this is the right place to post this, but I'm having a strange issue. I've gotten the Jenkins/Jira integrations setup and I can see the pipeline and successful builds in my Jenkins for Jira configuration section inside of Jira, but I'm not seeing the builds show up in the Development section on the tickets themselves. 

As far as I can tell, the branch name, PR title, and commit message all contain the ticket ID, so I'm not sure what's causing them to not show up in the Development section of the ticket. Any ideas?

 

Posted as a separate discussion: https://community.atlassian.com/t5/Jira-questions/Jenkins-for-Jira-is-detecting-builds-but-isn-t-pulling-issue-IDs/qaq-p/2071989

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events