Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Link Slack Threads on JSM Chat Created Tickets

Summary

You may be using Slack with Jira to create tickets from Slack messages, such as with Atlassian Assist. However, there natively is no way to have a link to the Slack message that created the Jira ticket within the Jira ticket thread itself. How can we achieve this?

This can be achieved using a Slack Triage Channel with an Automation Rule using a couple of Slack API requests to then link the Slack Thread URL as a comment on that newly created Jira Issue.

Setup the Slack App

We will need to setup a new Slack App to obtain our API token and grant the appropriate access to the Slack App, for us to use the API and integration with Automation https://api.slack.com/apps

When setting up the app (which is built from the 'scratch' option) please ensure that the required scopes are filled out for the Bot API tokens and the User Tokens, those are listed and included in the screenshot below. This is very important to ensure your App works with the API calls used in the Automation Rule:

  • Bot and User Tokens
    • channels:history
    • groups:history
    • im:history
    • mpim:history

Screenshot 2023-08-13 at 4.39.17 PM.png

Please also be sure to use Bots and Permissions as the two features and functionality for the Slack App:

Screenshot 2023-08-13 at 4.46.38 PM.png

After that you will have a Bot User OAuth Token under that specific app within: Features -> OAuth and Permissions. This is the Authorization token you want to use for your API calls:

Screenshot 2023-08-13 at 4.33.39 PM.png

Setup the Automation Rule

Now that the Slack App is setup to interact with the Slack API we will configure the Automation Rule. This will utilize the Issue Created Trigger, when the initiator is Atlassian Assist (using a User Condition), then get the latest conversation in the history of conversations of the Slack Workspace, then get the hyperlink to that conversation, which will be posted as a comment on the Jira Issue. Please note that these API requests only require the Content-Type as application/x-www-form-urlencoded and the Authorization will always be Bearer.

 

Step 1. The first Send Web Request URL

The Web Request URL for getting the conversation history of a Slack Channel would be: https://slack.com/api/conversations.history?channel=channelID (here's a link on how to get the Channel ID: https://medium.com/@life-is-short-so-enjoy-it/slack-where-how-to-get-slack-channel-id-f6765ff37dcc)

Screenshot 2023-08-13 at 4.50.16 PM.png

Step 2. Create a Variable

The variable name can be anything. In this case I used {{lastofmessage}} as the name and the Smart Value we need to use is: {{webResponse.body.messages.ts.first}} to pull in the web responses timestamp for the last created message from that Slack Channel

Screenshot 2023-08-13 at 4.50.44 PM.png

Step 3. Second Send Web Request URL

The Web Request URL for getting the hyperlink to the message sent to the Triage Channel for your Assist created tickets: https://slack.com/api/chat.getPermalink?channel=XXXXXXXXXXXX&message_ts={{lastofmessage}}

Screenshot 2023-08-13 at 4.50.53 PM.png

Step 4. Add Slack URL as comment on Jira Issue, using the following as the comment, which can be shared with the customer or an internal only link, depending on your use case.

  • Slack Thread: {{webResponse.body.permalink}}

Screenshot 2023-08-13 at 4.54.27 PM.png

Automation in practice!

Screenshot 2023-08-13 at 5.05.22 PM.pngScreenshot 2023-08-13 at 5.07.05 PM.png

Relevant Documentation

3 comments

Thanks for this article. To confirm, we would have to set this up per channel in slack? Aka if we have multiple channels in Slack connected to JSM, we would have to set this automation up per channel? 

Like Christian Beaulieu likes this
Christian Beaulieu
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Sep 29, 2023

Hey @Sydney Hollingsworth ! Yes that is correct :) 

👀

Great job, mate! Love how you bridged Slack and Jira.

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events