January 9, 2019

Atlassian Jira Ticketing Support for CI/CD

Table of Contents

Key takeaway

In 2018, Harness shipped 24 major platform integrations for our customers, from Microsoft Azure to HashiCorp Terraform to Datadog. Today, we have over 40 different integrations to enable end-to-end Continuous Delivery across your apps, clouds, tech stacks, and tools.

One of the most requested integrations in 2018 was Jira ticketing support. Atlassian Jira provides customers (specifically dev teams) with project and issue tracking throughout their software delivery lifecycle. Integration with Harness Continuous Delivery was, therefore, a "no brainer."

Our customers requested the ability to do two simple things:
1. Track the progress of deployment pipelines in Jira.
2. Use Jira to approve/reject deployment pipeline stages or workflows.

I'm therefore very pleased (and relieved) to announce that both use cases are now available in Harness.

Having played with the integration the past week, it's actually pretty slick and easy to set up.

Integrating Jira With Harness

Integrating Jira with Harness takes less than a minute.
To get started go to Setup > Connectors and click Add Collaboration Provider

Add Jira with Connectors.

Next, select Jira from the type dropdown, provide an instance name, and supply the URL, username, and password for the Jira instance you wish to add:

Collaboration Provider

Finally, click the TEST button to verify your Jira connection. When completed, your Jira integration will look something like this:

Jira Server

Note: You can add/manage multiple Jira instances if required.

Tracking Pipeline Progress Using Jira

Harness now gives you the ability to create or update a Jira ticket as many times as you want during the execution of a pipeline, stage, or deployment workflow.

For example, let's edit an existing deployment workflow in Harness so we create a Jira ticket when our deployment workflow execution starts, and update the same Jira ticket when that workflow successfully completes.

To do this, let's open and edit an existing deployment workflow:

Deploy Workflow With Jira Ticket

To create our Jira ticket, let's click Add Step under the Pre-Deployment Steps dialogue.

Harness now gives us a list of commands we can add. You can see that Jira has been added as a new Collaboration command, so let's select it.

Jira Collaboration

To create a Jira ticket, we simply configure the Pre-Deployment Step as follows:

Pre-Deployment Step

Notice we can use Harness variables (using $ pre-fix) to populate Jira tickets with workflow, artifact, and pipeline context.

We can also create a new variable called "Jira" from the output so we can reference the same Jira ticket again in our workflow should we want to make updates.

To update the same Jira ticket we can configure a Post-Deployment Step in our deployment workflow as follows:

Post-Deployment Step

Notice we use the variable ${Jira.issueId} as a key to reference the same Jira ticket we created in our Pre-Deployment Step. This means we can incrementally add activity to the same Jira ticket without needing to remember ticket ids or identifiers.

Now, when we next run our deployment workflow, we see our Jira steps fully visualized (screenshot below) with context. Notice the deep-link to the Jira ticket we've just created in the bottom right of the screenshot:

Jira Workflow

Clicking on the deep-link shown in the above deployment workflow takes us directly to the Jira ticket to reveal all the activity we logged during the pre-deployment and post-deployment steps:

New Deployment Workflow

So there you have it: full progress tracking of your deployment pipeline in a single Jira ticket!

But wait...there's more!

Approving Pipelines Using Jira Tickets

Up until now, our customers could only approve/reject pipeline stages or workflow execution using big shiny buttons in our Harness UI:

Approve and Reject Buttons

Today, customers can now do all this inside a Jira ticket by simply updating the value of a pre-defined Jira ticket attribute.

For example, changing the Status attribute of a Jira ticket to "Deploy" or "Approved" could automatically approve the execution of a pipeline stage or deployment workflow in Harness.

Again, this literally takes a few minutes to configure and you're all good to go.

Adding Jira Approval For Pipeline Stages

Let's imagine we have a simple 3-stage deployment pipeline consisting of Development, QA, and Production.

Jira Approval

Now let's imagine we want a new Jira approval stage to govern how code is promoted from QA to production.

Click on the + symbol in between the QA and Production stage. Now, let's define what our Jira approval criteria should look like:

Jira Approval Stage

Select the Jira instance and Project you wish to use, then set the key/issue id for ticket context.
Lastly, define the ticket attribute/value criteria which will approve/reject your pipeline stage.

In the example above changing the ticket Status to Done will approve the pipeline stage and changing the ticket Status to "To Do" will reject the pipeline stage.

Once our Jira Approval is configured our pipeline now has 4 stages:

4 Stage Pipeline

Adding Jira Approval For Deployment Workflow Execution

Let's go back to our original deployment workflow which we added Jira ticket updates for:

Deployment Workflow

We can actually add a Jira approval to any part of this workflow.

Let's add a new Jira approval step after our Pre-Deployment "Create Jira Ticket" Step:

Pre-Deployment Steps - Create Jira Ticket

We can do this by selecting an Approval command from the Others list:

Others List: Approval

Like we did for the pipeline stage Jira approval, we simply define the approval criteria for our workflow execution:

Jira Workflow Approval

Now when we run our deployment workflow, execution will wait until someone approves the ticket in Jira.

Jira Workflow Approval

This can be done by updating the Jira ticket Status attribute to Done. Doing this will cause the deployment workflow to continue:

Ticket Status: Done

There we go. In just a few minutes you can configure Jira to approve your pipeline stages or deployment workflow execution. Bob is your Uncle.

What's Coming Next?

In a few weeks, we'll extend our Jira support to allow Jira tickets to be created for the following events:

  • Deployment Verification Failure (e.g. new performance or quality regression)
  • 24x7 Service Guard Failure (e.g. performance/availability)
  • A Rollback

For example, a developer might deploy a new microservice into production and our Continuous Verification might identify a new performance anomaly shortly after that needs to be captured, managed and actioned using a Jira ticket. This ends up providing a closed feedback loop to the developer.

We'll also have identical ServiceNow integration soon as well!

Want to try Harness? You're 2 minutes away from getting started with our trial.


You might also like
No items found.

Similar Blogs

No items found.
Continuous Delivery & GitOps