
DevOps has become one of the preferred software development models in recent years. It uses the same principles as Agile methodology, but while the latter is primarily focused on the development process, DevOps extends those principles to operations as well, hence the name.
Automation plays a crucial role in making DevOps efficient. However, you need a powerful project management tool designed to work with DevOps Pipelines, and Jira happens to be one of them.
This blog will walk you through automating DevOps pipelines with Jira and provide a few best practices for getting the most out of this exercise.
Setting Up Jira For DevOps Automation
For this blog, we are going to work on the premise that our DevOps environment is on Microsoft Azure, and we are using Exalate for integration.
Step 1: Install Exalate On Jira And Azure DevOps
The first step is to install the Exalate app into Jira and Azure DevOps. While several alternatives are available in the Atlassian Marketplace, none offer the advanced integration Exalate offers.
Step 2: Connect Jira To Azure DevOps
Once installed, the next step of the process is to Sync or Connect Jira and Azure DevOps and this can be initiated from either app. Here, let’s initiate the process from Azure DevOps. To do so, follow the below sequence:
Navigate to Organization settings -> Exalate -> Connections -> Initiate connection -> Enter the address of the Jira Instance. Once done, start entering the details of the project you want to sync between the two apps. Exalate offers two modes for this: a basic mode and a script mode for more advanced integrations.
Step 3: Set Up Sync Rules
Sync rules, simply put, decide what information you want to send between these two apps. This information can be anything from default or custom fields to issue types and more. Both incoming and outgoing sync rules can be set up on both apps for independent control.
Step 4: Setup Triggers For Automation
The final step is to set up the triggers that will automate the process. Triggers can be added to individual entity types, and you will need to use Jira Query Language (JQL) when creating them on JIRA and Work Item Query Language (WIQL) when creating them on Microsoft Azure.
Creating And Managing DevOps Pipelines With Jira DevOps
Once Jira software is integrated into your DevOps environment, the next step is creating and managing your DevOps pipelines. In Jira, this pipeline refers to the series of automated stages that move code from development to production while tracking progress in real-time.
Start by linking Jira issues to Azure Repos to enable real-time tracking of commits, branches, and pull requests. Next, set up CI/CD pipelines in Azure Pipelines. Enable OAuth to ensure secure data exchange in your Azure DevOps account.
You can automate pipeline actions in Jira using webhooks or Jira’s automation rules. For example, trigger issue status updates in Jira when an Azure build succeeds or fails. This ensures that every stage of the pipeline—from code commit to deployment—is tracked and reported in Jira without manual input.
Note: We have used Microsoft Azure and Exalate as an example here. Several other tools, such as Jenkins, GitLab, CircleCL, Bamboo, and TeamCity, can accomplish DevOps automation, and the process of integrating them will also vary.
Advanced Automation Techniques
Here are a few hypothetical scenarios that demonstrate a few advanced automation you can accomplish with Jira.
Scenario 1
A DevOps team manages its infrastructure on Terraform (an Infrastructure as Code (IaC) tool) and wants to set up a technique to automate infrastructure provisioning and link it to Jira issues.
How to achieve this?
The DevOps team can write a Terraform script to describe their infrastructure needs. Let’s assume these are stored in Azure Repos.
You can then use Azure Pipeline to automate the process of triggering these scripts. Set up an event listener on Azure Pipeline to look for the specific event to trigger the script.
How would this work in real-time?
A team member moves a Jira Issue to a specific status. This triggers an Azure Pipeline that initializes the Terraform script. The Pipeline then updates the Jira software with the update.
Scenario 2
A DevOps team wants to automate the testing process for their web application and have the test results automatically reported back to Jira DevOps. Let’s assume they are using Selenium for this scenario.
How to achieve this?
The team writes automated tests using Selenium, which is again stored in Azure Repos. They then set up pipelines to run their Selenium tests automatically and simultaneously set up additional pipelines to send the results of these tests back to Jira DevOps.
How would this work in real-time?
A code gets committed to Azure Repos. It triggers the pipeline to initialize the Selenium test script. Once the tests are complete, the pipeline sends the test results back to Jira. (You can set custom fields to capture details of the test, like Pass/Fail or detailed logs of the test.)
Best Practices for Automating DevOps Pipelines with Jira
The entire purpose of automating DevOps Pipelines is to reduce manual intervention to a minimum. These best practices will help you achieve that goal.
- Don’t try to reinvent the wheel, and stick to tried and tested methods.
- Integrate any CI/CD with Jira software like Jenkins, GitLab, or CircleCI directly using APIs. This gives you granular control and opens doors to more complex/advanced automation.
- Step real-time updates to trigger actions to external applications by configuring webhooks within Jira. At the same time, set event listeners to handle incoming alerts and events and perform the corresponding actions.
- Create a dedicated user within Jira to automate your DevOps pipelines. Doing so will first allow you to have better access control and make it easier to track any changes.
- This brings us to the next point: monitoring and logging everything that happens in your DevOps pipeline. Use a third-party monitoring tool, such as Middleware or Prometheus, and integrate it with Jira. Set up alerts to stay on top of things.
- Finally, take advantage of Jira’s reporting capabilities to monitor your key DevOps metrics (lead time for changes, change failure rate, deployment frequency, and mean time to recovery).
Wrapping Up
To wrap up, automating your DevOps pipelines with Jira can significantly improve your development process at every stage. Jira offers over a thousand integrations, which opens up a world of possibilities to automate everything from Infrastructure provisioning to testing and everything in between. Stick to the best practices, and you will be just fine.
Automation has its advantages, but you still need to stay on top of your DevOps pipelines to detect and address any issues before they get out of hand. To do so, you need a solution that tracks key metrics, logs events and sends real-time alerts.
