ChatOps Workflows

Turn messaging apps into a powerful interface for operational processes.

Connect internal and external applications to build powerful utilities with just a few lines of code.

On-prem, private cloud or use hosted solution.

Integrations

Slack

Discord

Google chat

Jira

HTTP

Gmail

ChatGPT

Sheets

and more …

Example: Notify Slack channel when a new Confluence page created

The workflow is triggered when a new page is created in Confluence. If the page contains a specific label, a Slack message with a snippet of the content is sent to a designated Slack channel.

Integrations: Slack, Confluence

Prerequisites: Slack and Confluence connection setup

Variables: FILTER_LABEL, SNIPPET_LENGTH, SLACK_CHANNEL

Trigger: Webhook from Confluence when a page is created

Flow: 

  1. Check if the specified label is present on the page. If not, terminate the workflow.
  2. Create a snippet of the content and draft a message for the user.
  3. Send the message to the specified Slack channel
import os
from autokitteh.atlassian import confluence_client
from autokitteh.slack import slack_client


def on_confluence_page_created(event):
    """Workflow's entry-point."""
    confluence = confluence_client("confluence_connection")
    page_id = event.data.page.id

    # Ignore pages without the filter label, if specified.
    page_labels = confluence.get_page_labels(page_id)["results"]
    label_names = [label["name"] for label in page_labels]
    if os.getenv("FILTER_LABEL") not in label_names + [""]:
        print(f"Filter label not found in page: {label_names}")
        return

    # Read the page body.
    res = confluence.get_page_by_id(page_id, expand="body.view")
    html_body = res["body"]["view"]["value"]

    _send_slack_message(event.data.page, html_body)


def _send_slack_message(page, html_body):
    snippet_length = int(os.getenv("SNIPPET_LENGTH"))
    message = f"""
    A new page has been created in the `{page.spaceKey}` space.
    *Title*: {page.title}
    *Snippet*: ```{html_body[:snippet_length]}\n```
    <{page.self}|Link to page>
    """

    slack = slack_client("slack_connection")
    slack.chat_postMessage(channel=os.getenv("SLACK_CHANNEL"), text=message)

Benefits

Even More

Contact Us

"*" indicates required fields

Please let us know what's on your mind. Have a question for us? Ask away.