Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Use the Put EventBridge/CloudWatch Events action to process Bamboo tasks and notifications, Jira workflow transitions and Jira Service Desk automation rule executions with Amazon EventBridge (Amazon CloudWatch Events) to connect application data from your own apps, SaaS, and AWS services:

Amazon EventBridge is a serverless event bus that makes it easy to connect applications together using data from your own applications, Software-as-a-Service (SaaS) applications, and AWS services. [...] You can set up routing rules to determine where to send your data to build application architectures that react in real time to all of your data sources. EventBridge makes it easy to build event-driven applications because it takes care of event ingestion and delivery, security, authorization, and error handling for you.

Integrations

You can use the Put EventBridge/CloudWatch Events action with the following integrations:

Requirements

The Put EventBridge/CloudWatch Events action requires sufficient IAM permissions - an adequate IAM policy similar to the one provisioned by the Automation with AWS (Core) CloudFormation template might look as follows:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "events:PutEvents",
                "events:TestEventPattern"
            ],
            "Resource": "*",
            "Effect": "Allow",
            "Sid": "CloudWatchPutAndTestEvents"
        }
    ]
}

(lightbulb) Refer to Using Identity-Based Policies (IAM Policies) for EventBridge for details on how to create more granular/secure policies.

Configuration

To configure an Put EventBridge/CloudWatch Events action:

  1. Complete the following settings:

    Parameters

    Specify the action parameters according to the following skeleton in JSON format – refer to events . put-events for details:

    You can inject contextual variables into the remote action payload, refer to Entity Variables for details.

    Event Patterns in EventBridge (CloudWatch Events)

    This is an opinionated brief skeleton that works well for ingesting custom events from Atlassian products – refer to Events and Event Patterns in EventBridge (CloudWatch Events) for details on these and other available fields.


    Put EventBridge/CloudWatch Events skeleton - Atlassian Workflow Event
    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "",
          "DetailType": "",
          "Detail": ""
        }
      ]
    }

Entity Variables

You can inject contextual workflow variables with workflow entities into the remote action payload template – currently available entities are:

Examples

  • Page:
    Put EventBridge/CloudWatch Events - Atlassian Workflow Event — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.


    Put EventBridge/CloudWatch Events parameters example - Atlassian Workflow Event (escaped manually)

    {
      "Entries": [
        {
          "Source": "net.utoolity.atlassian",
          "DetailType": "Atlassian Workflow Event",
          "Detail": "{ \"event\": \"$event.simpleName\", \"traceId\": \"$event.traceId\" }"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Atlassian Workflow Event (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian",
          "DetailType": "Atlassian Workflow Event",
          "Detail": "$util.escapeJson('{
            "event": "$event.simpleName",
            "traceID": "$event.traceId"
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Bamboo Build Notification — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Bamboo Build Notification (escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Build Notification",
          "Detail": "{ \"plan\": $plan, \"resultsSummary\": $resultsSummary }"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Bamboo Build Notification (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Build Notification",
          "Detail": "$util.escapeJson('{
            "plan": $plan,
            "resultsSummary": $resultsSummary
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Bamboo Build Task Execution — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.


    Put EventBridge/CloudWatch Events parameters example - Bamboo Build Task Execution (escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Build Task Execution",
          "Detail": "{ \"agentId\": \"${bamboo.agentId}\", \"buildResultKey\": \"${bamboo.buildResultKey}\", \"resultsUrl\": \"${bamboo.resultsUrl}\" }"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Bamboo Build Task Execution (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Build Task Execution",
          "Detail": "$util.escapeJson('{
            "agentId": "${bamboo.agentId}",
            "buildResultKey": "${bamboo.buildResultKey}",
            "resultsUrl": "${bamboo.resultsUrl}"
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Bamboo Deployment Notification — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Bamboo Deployment Notification (escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Deployment Notification",
          "Detail": "{ \"plan\": $plan, \"deploymentResult\": $deploymentResult }"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Bamboo Deployment Notification (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Deployment Notification",
          "Detail": "$util.escapeJson('{
            "plan": $plan,
            "deploymentResult": $deploymentResult
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Bamboo Deployment Task Execution — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Bamboo Deployment Task Execution (escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Deployment Task Execution",
          "Detail": "{ \"agentId\": \"${bamboo.agentId}\", \"buildResultKey\": \"${bamboo.buildResultKey}\", \"resultsUrl\": \"${bamboo.resultsUrl}\", \"deploymentProject\": \"${bamboo.deploy.project}\", \"deploymentEnvironment\": \"${bamboo.deploy.environment}\" }"
        }
      ]
    }
    

    Put EventBridge/CloudWatch Events parameters example - Bamboo Deployment Task Execution (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo Deployment Task Execution",
          "Detail": "$util.escapeJson('{
            "agentId": "${bamboo.agentId}",
            "buildResultKey": "${bamboo.buildResultKey}",
            "resultsUrl": "${bamboo.resultsUrl}",
            "deploymentProject": "${bamboo.deploy.project}",
            "deploymentEnvironment": "${bamboo.deploy.environment}"
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Bamboo System Notification — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Bamboo System Notification (escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo System Notification",
          "Detail": "{ \"plan\": $plan }"
        }
      ]
    }
    

    Put EventBridge/CloudWatch Events parameters example - Bamboo System Notification (escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Bamboo System Notification",
          "Detail": "$util.escapeJson('{
            "plan": $plan
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Jira Core Post Function — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Jira Core Post Function (complete issue shape)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Jira Core Post Function",
          "Detail": "$issue"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Jira Core Post Function (selected fields, escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Jira Core Post Function",
          "Detail": "{ \"issueKey\": \"$issue.key\", \"issueUrl\": \"$issue.self\", \"issueSummary\": \"$issue.fields.summary\" }"
        }
      ]
    }

    Put CloudWatch Events parameters example - Jira Core Post Function (selected fields, escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.bamboo.automation-with-aws-bamboo",
          "DetailType": "Jira Core Post Function",
          "Detail": "$util.escapeJson('{
            "issueKey": "$issue.key"
            "issueUrl": "$issue.self"
            "issueSummary": "$issue.fields.summary"
          }')"
        }
      ]
    }
  • Page:
    Put EventBridge/CloudWatch Events - Jira Service Management Then Action — This parameters template demonstrates the Put EventBridge/CloudWatch Events action:

    JSON escaping requirements

    If a parameter within the JSON formatted parameters template is a JSON structure in itself (e.g. the Lambda function payload), it needs to be escaped before adding it as a value - this has two implications:

    • (tick) custom content needs to be escaped, which can be achieved by Composing action payloads with utility functions, specifically the $util.escapeJson() function

    • (warning) variables with conflicting content (e.g. multi line variables like JIRA's $issue.fields.description or Bamboo's $notification.textEmailContent or JSON structures retrieved via JSONPath) need to be escaped twice, via $util.escapeJson($util.escapeJson(...)) - we are exploring options on how to make this easier in a future release

    Event Patterns in CloudWatch Events

    This is an opinionated example that works well for ingesting custom events from Atlassian products – refer to Event Patterns in CloudWatch Events for details on these and other available fields.

    Put EventBridge/CloudWatch Events parameters example - Jira Service Management Then Action (complete issue shape)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.jira.automation-with-aws-jira",
          "DetailType": "Jira Service Management Then Action",
          "Detail": "$issue"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Jira Service Management Then Action (selected fields, escaped manually)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.jira.automation-with-aws-jira",
          "DetailType": "Jira Service Management Then Action",
          "Detail": "{ \"issueKey\": \"$issue.key\", \"issueUrl\": \"$issue.self\", \"issueSummary\": \"$issue.fields.summary\" }"
        }
      ]
    }

    Put EventBridge/CloudWatch Events parameters example - Jira Service Management Then Action (selected fields, escaped with utility function)

    {
      "Entries": [
        {
          "Time": "$event.timestamp",
          "Source": "net.utoolity.atlassian.jira.automation-with-aws-jira",
          "DetailType": "Jira Service Management Then Action",
          "Detail": "$util.escapeJson('{
            "issueKey": "$issue.key"
            "issueUrl": "$issue.self"
            "issueSummary": "$issue.fields.summary"
          }')"
        }
      ]
    }

How-to Articles

Filter by label

There are no items with the selected labels at this time.

Frequently Asked Questions (FAQ)

Atlassian account required

Due to a regression within Questions for Confluence Cloud, you need to log in with your Atlassian ID (or sign up for a new account) to access these automatically curated FAQs (refer to UAA-312 for the background).

  • No labels