Skip to main content
Skip table of contents

Use Jira tickets to drive Deployments

Numerous organizations leverage Jira tickets to manage and track their deployment requests. This approach proves highly beneficial when coordinating with multiple stakeholders across an organization for requesting, approving, and executing application deployments to various environments.

Jira Automation enables seamless updates of environment statuses and deployments in Golive directly from your Jira tickets. This documentation provides you with actionable examples to jumpstart the creation of your own Jira-powered deployment processes.

These examples are not just a starting point; they're designed to serve as a foundation that can be tailored to your unique needs and workflows, thereby optimizing your release management strategies. Whether you're a seasoned release manager or new to the role, these resources can empower you to streamline your deployments and deliver quality results more efficiently.


Description of the solution

Issue Type

A dedicated issue type called “Deployment Request” is used to track all deployments to Test and Production environments. Several fields are defined:

  • Deployed Version: a single value “Jira Version” custom field

  • Target Environment: a single value Environment Custom Field

  • Other optional fields, like the “Due date” in the screenshot below

Example of “Deployment Request” Screen

Workflow

A specific workflow is used to track deployment requests and it can be adapted to your needs:

Example of “Deployment Request” Workflow


Jira Automations

We are using 4 Jira Automation Rules:

  1. When the Request transitions from “In Review” to “In Progress”

    • The Target Environment status is updated to “Deploy

  2. When the Request transitions from “In Progress” to “Done” (Deployment Successful)

    • The selected “Deployed Version” is deployed to the selected “Target Environment” in Golive

    • The Jira issues marked as Done and fixed in the “Deployed Version” are automatically marked as deployed in Golive and Jira

    • The Target Environment status is updated to “Up

  3. When the Request transitions from “In Progress” to “Canceled” (Deployment Failed)

    • The Target Environment status is updated to “Down

  4. When the Request transitions from “Done” to “Canceled” (Cancel Deployment)

    • We rollback by deleting the deployment in Golive and in the Jira issues that were marked as deployed


Configuration guide

STEP 1 “Deployment Request” Issue Type

If you are using a company-managed Jira Project, the following steps should be performed by a Jira Admin:

  • Create your “Deployment Request” Issue Type and Screens with the following required fields

    • Deployed Version: a single value “Jira Version” custom field

    • Target Environment: a single value Environment Custom Field

  • Create your Workflow and assign it to your “Deployment Request”

If you are using a team-managed Jira Project, you just need to be Project Admin in order to create this new “Deployment Request” issue type and define a workflow.

STEP 2 “Deployment Request - In Progress” Automation Rule

When the Request transitions from “In Review” to “In Progress”, the Target Environment status is updated to “Deploy”.

1. Trigger

2. Issue Type Condition

3. Send web request (get Target Environment ID)

Web request URL:

CODE
https://golive.apwide.net/api/customfield/environment/selected?issueKey={{issue.key}}&customfieldName={{#urlEncode}}Target Environment{{/}}

“api-key” header: generate a Golive API Token and paste it as value.

4. Create variable

Variable name:

CODE
environmentId

Smart value:

CODE
{{webResponses.last.body.items.id}}

5. Log action

Log message:

CODE
environmentId: {{environmentId}}

6. Send web request (update Target Environment status)

Web request URL:

CODE
https://golive.apwide.net/api/status-change?environmentId={{environmentId}}

“api-key” header: paste the previously generated Golive API Token

Custom data (make sure the status exists in your configuration):

CODE
{
  "name": "Deploy"
}

STEP 3 “Deployment Request - Successful” Automation Rule

When the Request transitions from “In Progress” to “Done” (Deployment Successful):

  • The selected “Deployed Version” is deployed to the selected “Target Environment” in Golive

  • The Jira issues marked as Done and fixed in the “Deployed Version” are automatically marked as deployed in Golive and Jira

  • The Target Environment status is updated to “Up

1. Trigger

2. Issue Type Condition

3. Send web request (get Target Environment ID)

Web request URL:

CODE
https://golive.apwide.net/api/customfield/environment/selected?issueKey={{issue.key}}&customfieldName={{#urlEncode}}Target Environment{{/}}

“api-key” header: paste the previously generated Golive API Token

4. Create variable

Variable name:

CODE
environmentId

Smart value:

CODE
{{webResponses.last.body.items.id}}

5. Log action

Log message:

CODE
environmentId: {{environmentId}}

6. Lookup issues

JQL:

CODE
fixVersion in ({{issue.Deployed Version}}) and StatusCategory = Done

7. Create variable

Variable name:

CODE
issueKeys

Smart value:

CODE
{{lookupIssues.key.asJsonStringArray}}

8. Log action

Log message:

CODE
issueKeys: {{issueKeys}}

9. Send web request (update deployment of target environment)

Web request URL:

CODE
https://golive.apwide.net/api/deployment?environmentId={{environmentId}}

Custom data:

JSON
{
  "versionName": "{{issue.Deployed Version.name}}",
  "issueKeys" : {{issueKeys}}
}

“api-key” header: paste the previously generated Golive API Token

10. Create variable

Variable name:

CODE
deploymentId

Smart value:

CODE
{{webResponses.last.body.deploymentId}}

11. Log action

Log message:

CODE
deploymentId: {{deploymentId}}

12. Set entity property

We are storing the deployment ID with the Jira issue, in order to delete it in case of a future cancellation.

Property key:

CODE
apwDeploymentId

Property value:

CODE
{{deploymentId}}

13. Send web request (update Target Environment status)

Web request URL:

CODE
https://golive.apwide.net/api/status-change?environmentId={{environmentId}}

“api-key” header: paste the previously generated Golive API Token

Custom data (make sure the status exists in your configuration):

CODE
{
  "name": "Up"
}

STEP 4 “Deployment Request - Failed” Automation Rule

When the Request transitions from “In Progress” to “Canceled” (Deployment Failed), the Target Environment status is updated to “Down

1. Trigger

2. Issue Type Condition

3. Send web request (get Target Environment ID)

Web request URL:

CODE
https://golive.apwide.net/api/customfield/environment/selected?issueKey={{issue.key}}&customfieldName={{#urlEncode}}Target Environment{{/}}

“api-key” header: paste the previously generated Golive API Token

4. Create variable

Variable name:

CODE
environmentId

Smart value:

CODE
{{webResponses.last.body.items.id}}

5. Log action

Log message:

CODE
environmentId: {{environmentId}}

6. Send web request (update Target Environment status)

Web request URL:

CODE
https://golive.apwide.net/api/status-change?environmentId={{environmentId}}

“api-key” header: paste the previously generated Golive API Token

Custom data (make sure the status exists in your configuration):

CODE
{
  "name": "Down"
}

STEP 5 “Deployment Request - Cancellation” Automation Rule

This automation rule is used to rollback an already performed deployment (if any).

When the Request transitions from “Done” to “Canceled” (Cancel Deployment):

  • We rollback by deleting the deployment in Golive and in the Jira issues that were marked as deployed

  • The Target Environment status is updated to “Down

1. Trigger

2. Issue Type Condition

3. Create variable

Variable name:

CODE
deploymentId

Smart value:

CODE
{{issue.properties.apwDeploymentId}}

4. Log action

Log message:

CODE
deploymentId: {{deploymentId}}

5. Send we request (delete the deployment to rollback)

Web request URL:

CODE
https://golive.apwide.net/api/deployment/{{deploymentId}}

“api-key” header: paste the previously generated Golive API Token


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.