# Jira Automation | Expand its power with AWS SSM

> You will learn to use AWS SSM to expand the power of Jira with its automation feature and inspire you to design automation rules for your DevOps solution.

Vladimir Romanov · 2024-02-21 · https://kerno.io/blog/jira-automation-expand-its-power-with-aws-ssm/

## Introduction

Jira is an agile project management tool built for tracking issues and projects in progress, which is widely used in the IT industry. You can simply treat it as your team's platform for coding, collaboration, and release stages. As a DevOps Engineer, it is undeniably an important tool to automate and integrate the software development process and other IT teams like infrastructure, operation, and quality assurance teams.

In this article, we will learn how to use AWS SSM to expand the power of Jira with its automation feature and inspire you to design automation rules for your DevOps solution.

## Jira Automation 

Jira automation is a powerful feature that allows you to customize rules to streamline and enhance your workflows with **if-this-then-that-rules** based on events on Jira. Tons of behaviors you have done on Jira could become a trigger for others. It is also integrated with popular third-party tools or platforms like AWS SSM Document, Azure Runbook, GitHub, GitLab, Bitbucket, and Slack.

Some simple examples of using Jira automation,

-   Create a feature branch on a GitHub repository for a newly created Jira issue.
-   Inform other teammates on a Slack channel when an issue has been marked completed.
-   Trigger an AWS SSM Document when an issue has been transitioned to the next stage.
-   Assign an issue to a tester while passing to the QA stage.

The above examples showed how automation makes Jira a central hub of your IT department, and there are more and more things it can do for you.

## AWS System Manager (AWS SSM)

AWS SSM is a service that manages and automates operational tasks across your AWS resources. It simplifies the maintenance of infrastructure in a safer and more centralized way. It is divided into five units which are Operations Management, Application Management, Change Management, Node Management, and Shared Resources. These units cover a lot of common operational tasks.

From these five units, there are some sample use cases below,

-   Using Parameter Store in Application Management to centralize the storage of data, secrets, or other types of data.
-   Run Command in Node Management enables users to remotely execute commands on your EC2 instances or on-premises servers without manual interventions.
-   Define and automate complex tasks across AWS resources using Automation in Change Management

The power of AWS SSM is not limited to the above use cases. It has become an important tool for DevOps or Site Reliability Engineers on daily operation tasks like patching, resource management, and inventory.

## Prerequisites

What you will need to follow along with this article:

-   A Jira account with a project configured.
-   An AWS account with the permission on IAM role, SSM and Lambda
-   You need to be familiar with using the AWS Console

From the items above, we can create the workflow that triggers a Jira automation rule, then run an AWS SSM Document that invokes a Lambda Function and returns a “Hello World!” message.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab44e09f5ffbf223170_JzV2yKzWafJESJUM-tumUyODluHeQasXpD8HjBOKMDaGwU_oa6EmLL5ws1qSzMQVLTKPXlK552Ke6lfbQp1sUHBe9JGVo0lZ5YxI-ZqL7h52TBhZSF1b4hLfscjc9lGEnHLEly4nygGHJ1IV6Orq2w.png" alt="Figure 1 - Jira Automation AWS SSM - General Architecture Diagram" />
  <figcaption>Figure 1 - Jira Automation AWS SSM | General Architecture Diagram</figcaption>
</figure>

## Preparation on AWS

In this article, we will use the AWS Console for all resource creation and configuration. Therefore, please log in to your AWS Console before you start. We will use the \`us-east-1\` region as an example.

Link to console: [https://us-east-1.console.aws.amazon.com](https://us-east-1.console.aws.amazon.com)

### IAM Role

Jira automation uses IAM-based integration for connecting to any non-SNS resources. It means except for connecting to AWS SNS resources, we will need a separate IAM Role.

1.  Go to the IAM Dashboard.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab379e01e70a5fb14f3_bSf9GpK5TnTj2EzBP7d1RaDvLMOo54UdY_hLa43NXfp3AnDVBhZldJE_7vxttvz4JNkbafk-szXMUMYDKlKRzFtN1Zq7Iul0MCtdoisiKED69Z-CvADMj4P2p6lDEAQhHSCQ-hDK1yc2u8rhgvY-Eg.png" alt="Figure 2 - Jira Automation AWS SSM | AWS IAM Dashboard" />
  <figcaption>Figure 2 - Jira Automation AWS SSM | AWS IAM Dashboard</figcaption>
</figure>

2.  Choose **Roles** from the navigation menu, then click the **Create Role** button.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4d144d3ce3eda7205_Te_4JhinHl1c_JUfYqXas1M2h7ukdhsutSwGVvG3wx-hRz-SXWFSo70Nbk_fPJeLDKzmnzfHGJ0e2lFe8_0WSB134Hj9iokZUG1dkjPFW13Y4HQfW2b5DCtu86-eH5nb_sRFlkNZ8JHGRTx1FekEzQ.png" alt="Figure 3 - Jira Automation AWS SSM | AWS IAM Roles" />
  <figcaption>Figure 3 - Jira Automation AWS SSM | AWS IAM Roles</figcaption>
</figure>

3.  Choose **AWS Account** as the Trusted Entity Type.
4.  Select **Another AWS account** and enter the Atlassian Automation AWS account ID: **815843069303**.
5.  Select **Require external ID** and enter a random ID which we will use while setting up AWS connection on Jira. We use **jiraautomation** as an example.
6.  Click **Next**.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab49e1a7cd9952925f1_Czedm-nGvNDx3fpZvlRNwZOxc3U6M4NPBiBIpTiEkIgvTKCKfX-H2WhFqKmrmrb3Dmx35d8GQOLScmMc7XTvBAuYLcKN_ouPfjSihL873Rnq5h4XkVjd4rY6KSX-G0dH23iFOw2zSxF5qH4cA9mvbw.png" alt="Figure 4 - Jira Automation AWS SSM | New IAM Role Specification" />
  <figcaption>Figure 4 - Jira Automation AWS SSM | New IAM Role Specification</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4b453e0df2ea53d0a_tDfAN7ktwZFXm7cG_xzz78Prjk6lUkqF_h2xkL8OWCuZhG4AVeQZUJZD48x9Ed3gAIdiGjWbSH9-fzBrtXT0PEvTq3uWEQBqlhtTu3wC1aRlFnV8nMt-OdY-iOu2DsJE_9zFwI0qgvIpDC5yQyfd_w.png" alt="Figure 5 - Jira Automation AWS SSM | New IAM Role Specification" />
  <figcaption>Figure 5 - Jira Automation AWS SSM | New IAM Role Specification</figcaption>
</figure>

7.  Click **Next** without selecting any permission as we will create inline policies later.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab426082db2b3746cce_SPAGbGTtY6IYgXIYH3Trq2ZxlgyFV2G6C0qF5guHSwHEzXv3BUxAMhASw-mYA2ZXEkO83vtSd14ThBvsDgGAZW3hwjtVS5u4EeyPVKPfPWSo0n7hUGL5DHgh9fTOacEG4nqQJiLXx56gDgbmETUCpg.png" alt="Figure 6 - Jira Automation AWS SSM | New IAM Role Permissions" />
  <figcaption>Figure 6 - Jira Automation AWS SSM | New IAM Role Permissions</figcaption>
</figure>

8.  Enter a **Role name** and **Description**. The role name must begin with \`atlassian-automation-\`.
9.  Review your configuration, then click **Create role**.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4fc47dd06300049c9_KS_gUSTaWowGh2yvzpc6wJYdSzRmsb0V5K8t34qkH15TO6lFP77T1dMURokZMchW38lbSZKmLxi6plqEMPy9_iuiGwg853TebrkY2IiWnF86F2TTs5IrQqkD1F6gd3KTMiqAAlnBzACopYfYpYm5bg.png" alt="Figure 7 - Jira Automation AWS SSM | Role Details" />
  <figcaption>Figure 7 - Jira Automation AWS SSM | Role Details</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab48f96346277fce52e_G-aRBt_AFYK3vFylpVGvsnyacjq_WC1hsjhjbAeGBFJd5pg2IXRSfqa8eL85Y8gaSU8GoRPUMqw4TPedAtYaMj9g6Z8vUjhcvIpn5SELSqvc4U2AmxGozuxp5W5Ay5jE8M4fh8aG6m3DdmmYuVI0qw.png" alt="Figure 8 - Jira Automation AWS SSM | Role Details" />
  <figcaption>Figure 8 - Jira Automation AWS SSM | Role Details</figcaption>
</figure>

10.  Go back to the Role dashboard and search for the newly created role.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4b2687fe4058760b4_p81I8BNHLkvVkYo4bfaP9A1Uu1s4JdWhMuXii8BN0HsnrIJZNfa4sN1DMmGyzQF4WD4NAMNFG9RhSfhNCZMXMwaHmYVJ6cteDTp-2mf9KgVJJeu8ljzkyzYlZDw7VFfjZZfSwb8b-MyetdZEdyNCxQ.png" alt="Figure 9 - Jira Automation AWS SSM | New IAM Role" />
  <figcaption>Figure 9 - Jira Automation AWS SSM | New IAM Role</figcaption>
</figure>

11.  Select the role from the search result.
12.  Select **Create inline policy** from the pull-down menu **Add permissions**.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab351a6856f1fd26cd0_K0gZEk_acyKCv49MO6T8RHiWu-1SalfdzeLKWO_bndXcwrI4LckCrGVQX9Fodwe-JgN3xvkpGMaY1nm4xOEQK1zPnzF66qIW1KLaKm4m4w6FCyvkBxcVz_9BpverWRKOgxuPRd8Fx5-RM_Gm1boTZQ.png" alt="Figure 10 - Jira Automation AWS SSM | IAM Role Inline Policy Creation" />
  <figcaption>Figure 10 - Jira Automation AWS SSM | IAM Role Inline Policy Creation</figcaption>
</figure>

13.  Select **JSON** as the display mode of the policy editor.
14.  Write the JSON policy with the following permissions.

-   List SSM Documents.
-   Get SSM Document.
-   Start an Automation execution.
-   List all available AWS regions.
-   Invoke a Lambda Function with a specific name.

15.  Or you can use the following example by replacing some fields with your value.

-   Replace **<AWS Account ID>** with your AWS account ID.
-   Replace **<Lambda Function Name>** with the name of the Lambda Function we will create soon. We will use **TestPythonApp**.

```
{    
  "Version": "2012-10-17",    
  "Statement": [        
    {            
      "Effect": "Allow",            
      "Action: [
        "ssm:ListDocuments",                
        "ssm:GetDocument",                
        "ssm:StartAutomationExecution",                
        "ec2:DescribeRegions"            
      ],            
      "Resource": "*"        
    },        
    {            
      "Effect": "Allow",            
      "Action": "lambda:InvokeFunction",            
      "Resource": "arn:aws:lambda:*::function:"        
    }    
  ]
}
```

16.  Click **Next**.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab47848eba258971e3b_V5q_8gqjScpxV2tTU371amcJ754tPT6J5ccQd6QaRh5ZHaomOexRlL8Pm1R8qFsygFB6NKc2b75LgVcq-kb2dY_C-h_5TjvLTQuAyCLSoyXJkFMaYdjEt-SGmrBZ33-R31VUWDGvlznZ6v3GyI7qLA.png" alt="Figure 11 - Jira Automation AWS SSM | IAM Role Permissions in JSON" />
  <figcaption>Figure 11 - Jira Automation AWS SSM | IAM Role Permissions in JSON</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4689aebce1feaebd9_5PbvQa4was3XE5dirA9_Ky7CG2kdaOf54chF0HexUtlb9OfPg718rz-gpDAL-Gb9RdaasVp_uq_jeGMmenhRPdlt3cq8YVFOXpX44oe1aMzAhsVutDGuITL3CL3dYvvFK6nbD6LyeDbWPJJ6rueCXA.png" alt="Figure 12 - Jira Automation AWS SSM | IAM Role Permissions in JSON" />
  <figcaption>Figure 12 - Jira Automation AWS SSM | IAM Role Permissions in JSON</figcaption>
</figure>

17.  Enter a policy name.
18.  Review the permissions and click **Create policy**.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4d0cb1730c04ad144_zODZC11Ja-GLbmK89Zt59IdqrTGHFYw_vaK929LV4xYBCtohhxa-vz2ikO8DkiY5A-5uI9cjUncLe6b_rtLETUGDOX3N2JV96iR0b-W6HaGzPBhsUpMXxtlHQpa5goQS-radPH5SlxCkywgZcJxyGA.png" alt="Figure 13 - Jira Automation AWS SSM | IAM Role Policy" />
  <figcaption>Figure 13 - Jira Automation AWS SSM | IAM Role Policy</figcaption>
</figure>

Now, you have an IAM role with the necessary permissions for Jira automation.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4c41dd5c55e60116a_bPbTYGVCYq7Y93dlvuUIx6vFzFJ6_TKLAMvw4FyVw_HaPOaCtHhGUpLBWTGdjjxQjtfhmKC6QStbA4CbKgjUowMELk2xdt2vQSG-l351_JIs9JCprry2Q9Oo8zfh8h1l7jOpwFUTtc4Yx0NPKNa3LA.png" alt="Figure 14 - Jira Automation AWS SSM | IAM Role Policy" />
  <figcaption>Figure 14 - Jira Automation AWS SSM | IAM Role Policy</figcaption>
</figure>

### Lambda

In this example, we will create a simple Lambda Function. When our Jira automation rule triggers the SSM Document, it will invoke this Lambda Function.

Lambda Function is commonly used in DevOps solutions with different use cases because of its serverless and scalable feature. As it supports popular programming languages like Python, Java, Node.js, Ruby, and .NET, it extends the possibilities of integrating different platforms with Jira automation rules. In later sections, you will see some examples of how it helps DevOps solutions.

1.  Go to the Lambda Dashboard.
2.  Click the **Create function** button.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab43033c2934de31327_klozjQcoBdwJ_4mf32xQ7FoJuMZ0Hzqybo4kbYDxl6J9RtqGun9TxVODJRsY7XCS6es4UBgaYrS9CUHy-Zg25SKlK7Yt0mci4B01MCAffkAe67uIBjDd_dfHgTE2S6Vbi2s_3-SpQ1d7uidzO6FshA.png" alt="Figure 15 - Jira Automation AWS SSM | AWS Lambda Function" />
  <figcaption>Figure 15 - Jira Automation AWS SSM | AWS Lambda Function</figcaption>
</figure>

3.  Select the **Author from scratch**.
4.  Enter the **Function name**. You should use the same name “**TestPythonApp**” while creating the inline policy of the IAM Role created in the previous section.
5.  Select **Python 3.12** for Runtime. The version number could be different as AWS continuously updates it to the latest Python version.
6.  Leave the remaining fields to default. Click the **Create function** button.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4580194f666593319_sI-aBLrX6iRJshtmQ1KuJp10XTlwvnmC_8a1R6n3rhSrFtGuP-ZDX8IbYZDRhfed7YGy6k8c-aihNPyVLi6NetgSk1earPCDIp1HklpUYij0OeNUoNvC4i2IdBWpQ26PI5ut6AqyAGaCYmFW7f6NHg.png" alt="Figure 16 - Jira Automation AWS SSM | Deploying an AWS Lambda Function" />
  <figcaption>Figure 16 - Jira Automation AWS SSM | Deploying an AWS Lambda Function</figcaption>
</figure>

7.  You now have a Lambda function.
8.  Replace the default Code Source with the following lines,

```
def lambda_handler(event, context):    
  message = "Hello World!"        
  return message
```

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4b65024575f7f928e_LmHi56Lchoq4_jikCx_aarnPT27HRvDaFuIzUVxwY7Fe09OuRBtlrqigK53k4Sm0ISOU517t05PI0D1H0B11zVBeHn3t1g4F5XYbt-deQC_3IVcS-MLRn1fdDevBPgmTVMmJFSbj7G3j2y46REXrrg.png" alt="Figure 17 - Jira Automation AWS SSM | Python App" />
  <figcaption>Figure 17 - Jira Automation AWS SSM | Python App</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4580194f66659330b_JdzBITUGk4l2OEj30s-M5MPPPbtQTnPfoyYTTny4oyA16MjZD2ke-axsr29YCN_GzyeMNefjzmgIk2xaBSbw1VQYw2fF0-vD3Eacthu6zwNrss_YjZKXhGCuXvNrxgbzt9O1QrHKx7AAUeZuWq0uZA.png" alt="Figure 18 - Jira Automation AWS SSM | Python App" />
  <figcaption>Figure 18 - Jira Automation AWS SSM | Python App</figcaption>
</figure>

9.  Select **Test** from the tab.
10.  Click the **Test** button.
11.  The function should be executed successfully with a “Hello World!” as the return.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab43a19e9ba9fad8ded_EB3QffVr-CiLeOESwyry1f-zGedi2F2-U9XdMFwvFn08hy1ZxfUXFrwLTbOd7q8topyhlNskjHZhLUuwr6jhEpvzKTwcBQihG4jZfEjb4OmqPuEWNuYtYVl39FTXVEEbYqtiAxE_FoPNcnonR0g0TA.png" alt="Figure 19 - Jira Automation AWS SSM | Testing the Function" />
  <figcaption>Figure 19 - Jira Automation AWS SSM | Testing the Function</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4bd2c7e18d97b5416_ou9iSHAXMpyp8cXQSRuOEOpsDYFlaFYclIlxrYacJDRzAYNLIoGIcnkLUOtnhpQAeJFpujREANqO9eQHT8sh-kNKyKOHjd-fffSrcjXTBBdUa-bKiTcpXD2ZSQML_im0ycVJ9vn_KfrmHVCVXrerog.png" alt="Figure 20 - Jira Automation AWS SSM | Successful Test of Python Application" />
  <figcaption>Figure 20 - Jira Automation AWS SSM | Successful Test of Python Application</figcaption>
</figure>

Now you have a simple Lambda Function ready to invoke.

### SSM Document

Finally, we need an SSM Automation Document which will be specified while setting up the Jira automation rule. When this document is being executed, it will invoke the Lambda Function we created in the previous section.

1.  Go to the System Manager Dashboard
2.  Choose **Documents** from Shared Resources in the navigation menu.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4e1e19a63fe44bba4_RxQktuOjnoXsa8R034eAvYQiWxro-LNGjfmFz2CVIzUDFg1JQ2nkrtKgGFlmiCA4UdyJRfL-i-ANJF-qMv28SuUWwAY1nnkcfK_RpKtlnHzOucMW46v-mFvIxHa3WgScmMLsktuBEyjaHYWjfL00bg.png" alt="Figure 21 - Jira Automation AWS SSM | AWS Systems Manager" />
  <figcaption>Figure 21 - Jira Automation AWS SSM | AWS Systems Manager</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab48f96346277fce537_u60txL5ZjWvBjaXHbezZ_HEYePLuIKb7kd3cmZJqjjMqVkLsomPL3scJlnaRUTR9GjuHX9EXBhl0gv6ilONSLTDjAhoM_fpj_goL1YzHZeoZiiyph3fMAvVr8tGDo2Ja5zzzAHatlXTxA2-yrCgkCw.png" alt="Figure 22 - Jira Automation AWS SSM | AWS Systems Manager - Documents" />
  <figcaption>Figure 22 - Jira Automation AWS SSM | AWS Systems Manager - Documents</figcaption>
</figure>

3.  Click **Create document**, then choose **Automation** from the pull-down menu.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4a86b20bbbe9b1d88_mdnhwCdR6Js7CdsMWFwpRwujflAmAbd4CmDHTD8Le2VEPT3Lq0d1BQPTJSgv5XNMWotAaBqgbjkoogoibNdb6dEa0WJ7njz3423kJbIV_jHQv3PUuEhOdkyD9_AcOGNqZJ9VpJcI6hwvbij95SDMag.png" alt="Figure 23 - Jira Automation AWS SSM | AWS Systems Manager - Automation" />
  <figcaption>Figure 23 - Jira Automation AWS SSM | AWS Systems Manager - Automation</figcaption>
</figure>

4.  You will see a design panel.
5.  Update the document name. We use **JiraTestDoc** as an example.
6.  Pull **Invoke a Lambda Function** from the Actions menu to the design panel.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4d2b1f7fc3e4ff166_Jjmanw_taaUjNfvvRQ2FdQBijwD6Ged73IgxzBpKBixFRNhGkpFvxEj2kNLunZCE4O59p_ikRvb5GgJNdGkXRld6LQkQ_FG7TxP4FFULd6tHe7mngnuuW9ijiFlTkwQvVaauReVjY5Wjh1Q1ZElNPQ.png" alt="Figure 24 - Jira Automation AWS SSM | AWS Systems Manager - Automation" />
  <figcaption>Figure 24 - Jira Automation AWS SSM | AWS Systems Manager - Automation</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab40f4c3f87cb5b56e5_Hl6R9dj7em9tpV6t7FRpfPg1M17B8ei02_ofVdeipV3Yyuvy9ve1e2gXXUVEVOyT_Ki0opYaveHtEfy2wNS5Y3dXihYzsFAueC_NzW9lhUOW5MoAGp4ug0DvlKgZp2nuZ3TOFrDDAkqBtPo3JSS90Q.png" alt="Figure 25 - Jira Automation AWS SSM | AWS Systems Manager - Lambda Function Automation" />
  <figcaption>Figure 25 - Jira Automation AWS SSM | AWS Systems Manager - Lambda Function Automation</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab446b8159bfaed7354_B0NJ9PjaLI6Tu5P48nRJQ5T0xdniogxRME4cWSv5HtWI-p_tF_V4X7bYLPrEal1LDZI4mDIvRYTDxFDHeOgJOBIjw2MiTWFOxKoJtkIze9TSpiORAZewa-VTh-pM3EvoLVnjVEeuFqmfS4hve6kOw.gif" alt="Figure 26 - Jira Automation AWS SSM | AWS Systems Manager - Lambda Function Automation" />
  <figcaption>Figure 26 - Jira Automation AWS SSM | AWS Systems Manager - Lambda Function Automation</figcaption>
</figure>

7.  Choose **Inputs** from the tab in the menu.
8.  Open the **Function name** pull-down menu.
9.  Select the Lambda Function **TestPythonApp** we created in the previous section.
10.  Click **Create runbook** button.
11.  Ignore the recommendation window. Click **Create runbook** button.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab45b9d3971b399e42a_9pMMa-9J0ibSvEq67Mr5qRwetARSD_Ddmo4NywEnp2KidRg6jcXik6XGSh9gpWctB7kVmc85_DyJSeEzB257YG_A6uz81zgZsQg2MWgD-r5LglyZuAUgGvDf-GWmPoMkqiEr8IYgedyp0YnTYgopVA.png" alt="Figure 27 - Jira Automation AWS SSM | AWS Systems Manager - Function Specification" />
  <figcaption>Figure 27 - Jira Automation AWS SSM | AWS Systems Manager - Function Specification</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4fc4dc3863f25e0bc_HKxtq3_X70lccsUw2V07qxA1hir0Vs6u5tZ9jA4GKRzKhem0nDU2IJBkbbWSOlyPP24VEPB3s4Gimcs4eiORMTIN2_UwSPzi9GTZNVIcABV-YzUeGAzhVxlDv8FgoFhsBIzvJT_ZOWPUeUzbEXjmdg.png" alt="Figure 28 - Jira Automation AWS SSM | AWS Systems Manager - Create Runbook" />
  <figcaption>Figure 28 - Jira Automation AWS SSM | AWS Systems Manager - Create Runbook</figcaption>
</figure>

Now you have got an SSM Automation Document.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4472ae074b5bc1e72_u4D1653YXaKWmv6M52pM931gfi7XztCpbFMSTLSIOVOlWMvR7CVOumxknUh46Z3PD2ZanzefAPGW_miwqwCKFFcNwg9TAneijxkfgJkt6PXChz8aDMkm1PCF7jk4fugZjX2PI8W8TLR7yOoOBNll4w.png" alt="Figure 29 - Jira Automation AWS SSM | AWS Systems Manager - Deploying Automation" />
  <figcaption>Figure 29 - Jira Automation AWS SSM | AWS Systems Manager - Deploying Automation</figcaption>
</figure>

## **Preparation on Jira**

After we have prepared all the necessary resources on AWS, the final step is to create a Jira automation rule to trigger the execution of the SSM document. Then, we trigger the rule by transitioning an issue status from In Progress to Done.

1.  Go to your Jira project Kanban board.
2.  Choose **Project settings** from the tab.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab4c41dd5c55e601172_qEa8XfnnKSFViiprHEXGxr2M5AXSu03ubbMwM0VDX_2knJJUJhVJv6TC1O3gDNaqmAXTwvhgI6f8og5v9CyEWgQBXMji5Bj4fLrYOjnnam1-y_kfaxHvjUMnBlTsmzL2AsspbpICjSGkmYvFbSxkaw.png" alt="Figure 30 - Jira Automation AWS SSM | Jira Project Settings" />
  <figcaption>Figure 30 - Jira Automation AWS SSM | Jira Project Settings</figcaption>
</figure>

3.  Select **Automation** from the navigation menu.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab43a2eff0eab2b81a8_K6JTPMoImWyOCiEVBSivdDSkN-1WBemV1IbfhIKHlRSp6QGod614q6TxloyeHwfjQTXUGX6OyI6woN_j-1mN-HjQHKjHjEcKR7K3m93G0xnzKiW9CkzqnjNq1-e7wJyUhhIzZ06Z8PkkN5ZkpqcZqQ.png" alt="A screenshot of a computerDescription automatically generated" />
  <figcaption>Figure 31 - Jira Automation AWS SSM | Jira Project Settings</figcaption>
</figure>

4.  Click the **Create rule** button.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab436d2b98965d58f8c_4pgX-zpHryZZMEU_iGMTkgCP-Yw00t-FggAHtzOGMZje1qZfMLIs7lC0LKOsszFKVOKvAkb0z086fULQPSzWaPe84YHUDqjRKTWHq0PnmTRgkmjGHFdNH1-YJQQxZYce6Wc0mqovMjHCOJRHZOrjg.png" alt="Figure 32 - Jira Automation AWS SSM | Jira Automation Rules" />
  <figcaption>Figure 32 - Jira Automation AWS SSM | Jira Automation Rules</figcaption>
</figure>

5.  You will see a Rule Builder panel.
6.  Choose **Issue Transitioned** as the trigger, from status **IN PROGRESS** to status **DONE**.
7.  Click **Next**.
8.  Choose **THEN: Add an action**.
9.  Select **Run AWS SSM document**.
10.  Click **Connect**.
11.  Enter the ARN of the IAM Role we have created previously. You can find it from the AWS Console.
12.  Enter the External ID we have configured during IAM role creation. We have chosen **jiraautomation** as our example.
13.  Click **Save** and you can see a configuration panel on the right.
14.  Select the correct AWS region. We use **us-east-1** as an example.
15.  Select the SSM document we have created previously. We use **JiraTestDoc** as an example.
16.  Click **Next**.
17.  Click the **Turn on rule** and give the name of this rule. We use **TestJiraRule** as an example.
18.  Click the **Turn on rule** again.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64abc7e256a5821d2f52f_UkpBkoYNvC-MRE2oGFUBZG7hIQaPzFHvXdGNcC1LUYZiCGH5DAAB-0bgEDEjKeTcrqJvrZLHxjs2SnxNJ6fzSQsApHZVx7dyNT6Mm-OWNngCIsYWPx4UQ7_Zz06f4tOIlPpjm6dCJzOos0mQRe5ICA.gif" alt="Figure 33 - Jira Automation AWS SSM | Jira Automation Rules" />
  <figcaption>Figure 33 - Jira Automation AWS SSM | Jira Automation Rules</figcaption>
</figure>

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d64ab48ad3b606c077a139_YMbKAckgUp_2hjTBq2zd6w2x2LGtsuiyy_iWyCj9KiMH9LvycjSRTWW6FOgEkdPNON4LHFqYGnB7SOPJyGhVCW4KlSkNJYqHT8PGa-pPOywmMZiei9JwI9KvpsdGtg0SpxVJCWZOJHnoDbYT2aQHTw.gif" alt="A screenshot of a computerDescription automatically generated" />
  <figcaption>Figure 33 - Jira Automation AWS SSM | Jira Automation Rules</figcaption>
</figure>

We have prepared everything necessary. You can also create an issue for testing or use any existing issue in your project board. 

## **Result**

We can perform end-to-end testing that triggers the automation rule by transitioning the issue, then check the execution result from the audit log and AWS Console.

1.  Transit the testing issue from **In Progress** to **Done**.
2.  Go back to the Rule Builder panel and click the **Audit log** button.
3.  Check the latest execution if it has a **success** status.
4.  Expand the details and click **View execution status on AWS Management Console**
5.  Check on AWS Console if the execution outputs a “Hello World!” message.

<figure>
  <img src="/blog/images/jira-automation-expand-its-power-with-aws-ssm/65d662dffa9f3096bd5f893e_result.gif" alt="Figure 34 - Jira Automation AWS SSM | Jira Automation" />
  <figcaption>Figure 34 - Jira Automation AWS SSM | Jira Automation</figcaption>
</figure>

## **DevOps Use Cases**

As mentioned at the start of this article, Jira is a project management tool widely used in the IT industry as a centralized platform for teams to organize different stages of their work. Therefore, Jira automation plays a critical role in completing fully automated workflows. 

For the last part of this article, there is a list of DevOps use cases that you can use to utilize Jira automation, and for sure, there are some useful cases on when we need to integrate AWS SSM to cover its weaknesses.

Typical use cases with Jira Automation

-   Create a branch on GitHub repositories when an issue has been created.
-   Notify the QA team members on Slack when an issue has been transitioned to QA status.
-   Comment on an issue when it has passed each stage.
-   Assign the issue to the specific team when it has reached a specific stage.

More use cases with AWS SSM,

-   Authenticate to GitHub Rest API using Lambda Function and trigger a GitHub Actions workflow when an issue has transitioned.
-   Create an AWS Elastic Beanstalk environment while deploying a bugfix branch linked to an issue.
-   Trigger AWS CodeBuild for CI when there is a new commit against the feature branch linked to a feature ticket.

The above use cases are popular and useful in reducing daily manual tasks. Automating those tasks is also the responsibility of a DevOps Engineer. By using Jira automation with AWS SSM, you can create tons of possibilities that help your job.
