This is a Bolt for Python app used to interact with Jira Server.
Before getting started, make sure you have a development workspace where you have permissions to install apps. If you don’t have one setup, go ahead and create one.
To use this template, you need to install and configure the Slack CLI. Step-by-step instructions can be found in our Quickstart Guide.
# Clone this project onto your machine
slack create my-app -t slack-samples/bolt-python-jira-functions
# Change into the project directory
cd my-app
# Set up virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Before you can run the app, you'll need to store some environment variables.
- Rename
.example.env
to.env
- Follow these
Jira Instruction
to create an external application and get the
Client ID
(JIRA_CLIENT_ID
) andClient secret
(JIRA_CLIENT_SECRET
) values. - Populate the other environment variable value with proper values.
You'll know an app is the development version if the name has the string
(local)
appended.
# Run Bolt server
slack run
INFO:slack_bolt.App:Starting to receive messages from a new connection
To stop running locally, press <CTRL> + C
to end the process.
# Run ruff from root directory for linting
ruff check
# Run ruff from root directory for code formatting
ruff format
ruff check --fix
For an example of how to test a function, see
tests/functions/test_create_issue.py
.
Run all tests with:
pytest tests/
Contains apps.dev.json
and apps.json
, which include installation details for
development and deployed apps.
manifest.json
is a configuration for Slack apps. With a manifest, you can
create an app with a pre-defined configuration, or adjust the configuration of
an existing app.
app.py
is the entry point for the application and is the file you'll run to
start the server. This project aims to keep this file as thin as possible,
primarily using it as a way to route inbound requests.
Every incoming request is routed to a "listener". Inside this directory, we
group each listener based on the Slack Platform feature used, so
/listeners/shortcuts
handles incoming
Shortcuts requests,
/listeners/views
handles
View submissions
and so on.
Used by the CLI to interact with the project's SDK dependencies. It contains script hooks that are executed by the CLI and implemented by the SDK.