Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
technically-tracy committed Dec 12, 2024
1 parent 46b17d2 commit 428a58e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ In this tutorial, you'll learn how to configure custom steps for use with JIRA.

1. Create your app from an app manifest and clone a starter template
2. Set up and run your local project
3. Create a workflow using Workflow Builder with custom steps
3. Create a workflow with a custom step using Workflow Builder
4. Create an issue in JIRA using your custom step

## Prerequisites {#prereqs}
Expand All @@ -21,15 +21,20 @@ If you'd rather skip the tutorial and just head straight to the code, you can us

1. Navigate to the [app creation page](https://api.slack.com/apps/new) and select **From a manifest**.
2. Select the workspace you want to install the application in, then click **Next**.
3. Copy the contents of the [`manifest.json`](https://github.com/slack-samples/bolt-python-ai-chatbot/blob/main/manifest.json) file into the text box that says **Paste your manifest code here** (within the **JSON** tab) and click **Next**.
3. Copy the contents of the [`manifest.json`](https://github.com/slack-samples/bolt-python-ai-chatbot/blob/main/manifest.json) file below into the text box that says **Paste your manifest code here** (within the **JSON** tab), then click **Next**:

```js reference title="manifest.json"
https://github.com/slack-samples/bolt-python-jira-functions/blob/main/manifest.json
```

4. Review the configuration and click **Create**.
5. You're now in your app configuration's **Basic Information** page. Click **Install App**, then **Install to _your-workspace-name_**, then **Allow** on the screen that follows.

### Obtaining and storing your environment variables {#environment-variables}

Before you'll be able to successfully run the app, you'll need to obtain and set some environment variables.

1. On the **Install App** page, copy your **Bot User OAuth Token**. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next).
1. Once you have installed the app to your workspace, copy the **Bot User OAuth Token** from the **Install App** page. You will store this in your environment as `SLACK_BOT_TOKEN` (we'll get to that next).
2. Navigate to **Basic Information** and in the **App-Level Tokens** section , click **Generate Token and Scopes**. Add the [`connections:write`](https://api.slack.com/scopes/connections:write) scope, name the token, and click **Generate**. (For more details, refer to [understanding OAuth scopes for bots](https://api.slack.com/tutorials/tracks/understanding-oauth-scopes-bot)). Copy this token. You will store this in your environment as `SLACK_APP_TOKEN`.
3. Follow [these instructions](https://confluence.atlassian.com/adminjiraserver0909/configure-an-incoming-link-1251415519.html) to create an external app link and to generate its redirect URL (the base of which will be stored as your APP_BASE_URL variable below), client ID, and client secret.
4. Run the following commands in your terminal to store your environment variables, client ID, and client secret.
Expand Down Expand Up @@ -67,17 +72,26 @@ cd bolt-python-jira-functions

Start your Python virtual environment:

**For macOS**
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<Tabs groupId="os">
<TabItem value="macos" label="For macOS">

```bash
python3 -m venv .venv
source .venv/bin/activate
```

**For Windows**
</TabItem>
<TabItem value="windows" label="For Windows">

```bash
py -m venv .venv
.venv\Scripts\activate
```
</TabItem>
</Tabs>

Install the required dependencies:

Expand All @@ -97,6 +111,8 @@ 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:

```bash
Expand All @@ -117,7 +133,9 @@ If your app is up and running, you'll see a message noting that the app is start

![Start the workflow](/img/custom-steps-jira/2.png)

5. Under **Then, do these things** click **Add steps** to add the custom step. 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**.
5. 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`](https://github.com/slack-samples/bolt-python-jira-functions/blob/main/listeners/functions/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**.

![Custom function](/img/custom-steps-jira/3.png)

Expand Down Expand Up @@ -149,6 +167,6 @@ When finished, you can click the **Disconnect Account** button in the home tab t

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.

* To learn more about Bolt for Python, refer to the [getting started](../getting-started) documentation.
* To learn more about Bolt for Python, refer to the [getting started](/getting-started) documentation.
* For more details about creating workflow steps using the Bolt SDK, refer to the [workflow steps for Bolt](https://api.slack.com/automation/functions/custom-bolt) guide.
* For information about custom steps dynamic options, refer to [custom steps dynamic options in Workflow Builder](https://api.slack.com/automation/runonslack/custom-steps-dynamic-options).
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const sidebars = {
items: [
'tutorial/getting-started-http',
'tutorial/ai-chatbot',
`tutorial/custom-steps`
`tutorial/custom-steps-for-jira`
],
},
{ type: 'html', value: '<hr>' },
Expand Down

0 comments on commit 428a58e

Please sign in to comment.