docs/english/tutorial/custom-steps-for-jira/custom-steps-for-jira.md
In this tutorial, you'll learn how to configure custom steps for use with JIRA. Here's what we'll do with this sample app:
Before getting started, you will need the following:
Skip to the code If you'd rather skip the tutorial and just head straight to the code, you can use our Bolt for Python JIRA functions sample as a template.
manifest.json file below into the text box that says Paste your manifest code here (within the JSON tab), then click Next:https://github.com/slack-samples/bolt-python-jira-functions/blob/main/manifest.json
Before you'll be able to successfully run the app, you'll need to obtain and set some environment variables.
SLACK_BOT_TOKEN (we'll get to that next).connections:write scope, name the token, and click Generate. Copy this token. You will store this in your environment as SLACK_APP_TOKEN.For macOS
export SLACK_BOT_TOKEN=<your-bot-token>
export SLACK_APP_TOKEN=<your-app-token>
export JIRA_CLIENT_ID=<client-id>
export JIRA_CLIENT_SECRET=<client-secret>
For Windows
set SLACK_BOT_TOKEN=<your-bot-token>
set SLACK_APP_TOKEN=<your-app-token>
set JIRA_CLIENT_ID=<client-id>
set JIRA_CLIENT_SECRET=<client-secret>
Clone the starter template onto your machine by running the following command:
git clone https://github.com/slack-samples/bolt-python-jira-functions.git
Change into the new project directory:
cd bolt-python-jira-functions
Start your Python virtual environment:
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
<Tabs groupId="os"> <TabItem value="macos" label="For macOS">python3 -m venv .venv
source .venv/bin/activate
py -m venv .venv
.venv\Scripts\activate
Install the required dependencies:
pip install -r requirements.txt
Rename the .example.env file to .env and replace the values for each of the variables listed in the file:
JIRA_BASE_URL=https://your-jira-instance.com
SECRET_HEADER_KEY=Your-Header
SECRET_HEADER_VALUE=abc123
JIRA_CLIENT_ID=abc123
JIRA_CLIENT_SECRET=abc123
APP_BASE_URL=https://1234-123-123-12.ngrok-free.app
APP_HOME_PAGE_URL=slack://app?team=YOUR_TEAM_ID&id=YOUR_APP_ID&tab=home
You could also store the values for your SLACK_BOT_TOKEN and SLACK_APP_TOKEN here.
Start your local server:
python app.py
If your app is up and running, you'll see a message noting that the app is starting to receive messages from a new connection.
Under Then, do these things click Add steps to add the custom step. Your custom step will be the function defined in the create_issue.py file.
Scroll down to the bottom of the list on the right-hand pane and select Custom, then BoltPy Jira Functions > Create an issue. Enter the project details, issue type (optional), summary (optional), and description (optional). Click Save.
When finished, you can click the Disconnect Account button in the home tab to disconnect your app from your JIRA account.
Congratulations! You've successfully customized your workspace with custom steps in Workflow Builder. Check out these links to take the next steps in your journey.