Git Product home page Git Product logo

jira-unfurl-bot's Introduction

Jira Unfurl Bot Architecture

This document describes the architecture of the Jira Unfurl Bot, a Slack bot that unfurls Jira issues shared in Slack channels, providing a summary of the linked resource directly within Slack.

Overview

The Jira Unfurl Bot is a Python application that integrates Slack with Jira. It listens for specific events in Slack, such as app mentions and link sharing, and responds by fetching relevant information from Jira and displaying it in the Slack channel.

Key Elements

  1. Socket Mode: The bot uses the Socket Mode feature of Slack Bolt, which enables real-time communication between the bot and Slack over a secure WebSocket connection. This eliminates the need for setting up a public HTTP endpoint.

  2. Event Handling: The bot listens for two main events from Slack:

  • App Mention: When the bot is mentioned in a Slack channel, it responds with a simple "I'm alive" message to indicate that it is running and responsive.
  • Link Shared: When a Jira issue or version link is shared in a Slack channel, the bot intercepts the event, extracts the issue key or version ID from the link, and fetches the corresponding details from Jira.
  1. Jira Integration: The bot interacts with Jira using the Jira Python library. It authenticates using an access token provided as an environment variable (JIRA_ACCESS_TOKEN).
  • For Jira issue links, the bot fetches the issue details and constructs a formatted message with the issue key, status, summary, and issue type.

Configuration

The bot relies on the following environment variables for configuration:

  • SLACK_BOT_TOKEN: The bot token for the Slack app.
  • SLACK_APP_TOKEN: The app token for the Slack app, used for Socket Mode.
  • JIRA_ACCESS_TOKEN: The access token for authenticating with the Jira API.

Error Handling

If the required JIRA_ACCESS_TOKEN environment variable is not provided, the bot raises a ValueError and terminates.

jira-unfurl-bot's People

Contributors

omer-vishlitzky avatar osherdp avatar pastequo avatar oshercc avatar danmanor avatar

Stargazers

Dave Mulford avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.