Send Slack message to Jira issue assignee

Callum Carlile _Automation Consultants_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 16, 2020

Hi all,

I've got a workflow transition where you select the assignee and an option from a checkbox field on a transition screen. As soon as this screen is submitted and the issue transitions, I would like to send a Slack DM to said assignee (ideally with the checkbox value selected also, but no worries if not). It seems like it should be simple, but I can't seem to crack it.

I've tried so many different methods from Atlassian and Slack documentation but nothing seems to be working for me - I can only seem to send the notification to specific channels or to a set user, but I want this to send the DM's dynamically so that whoever is the assignee of the issue will receive a DM in slack. Any help/advice would be greatly appreciated!

2 answers

3 votes
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2020

Hey Callum,

You could use Automation for this - with some considerations:

  • The Slack IDs need to be synced as user properties in Jira - here's an article and script for doing that 
  • The Automation rule trigger would be the status change. This would be configured in Automation rather than in the workflow itself (slight difference in where it's set up)
  • In the "Channel or user" field at the bottom of the Automation action that sends a Slack message, you can use a smart value 
    @{{issue.assignee.properties.metadata.slack_id}}

    to send the direct message. The message body itself can have the value of your checkbox, also using a smart value

Hope that helps! I think this is a do-able message with the assistance of the user properties for Automation to pull from.

Cheers,
Daniel

Karl Hamilton July 22, 2021

Hello Daniel, thanks for your feedback, is there a way of doing this without a webhook URL? as it insists on one and i don't want to bother users of a slack channel with direct messages to others

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 22, 2021

Hey @Karl Hamilton ,

The "channel or user" field does override the default channel in the webhook, despite having to choose one when actually setting the webhook up. For example, using a webhook URL associated with #general and then putting a smart value in the "channel or user" field, no message is actually sent to #general. It's a bit counterintuitive!

Like jonathank likes this
Randy O_Neal
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 20, 2022

Daniel... thank you, this works like a charm!

Ismoyo Eko Purwanto
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 14, 2024

Hi @Daniel Eads 

 

Thank you for sharing. I have tried to use the assignee smart-values. However, it does not work when I send message to slack channel. Is there anything I missed? Kindly need your advice. 

 

Regards,

Moyo

 

Screenshot 2024-01-15 at 10.11.44.pngScreenshot 2024-01-15 at 10.11.57.png

0 votes
Karishma Walia April 12, 2024

I am getting this issue:

The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'users:read', 'provided': 'incoming-webhook'} 

I checked the permissions and my token as user:read permission. What could be the issue?

Lucas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 16, 2024

Were you able to solve this problem?

Karishma Walia April 29, 2024

@Lucas Hi, yes

I created the app again in slack and added all possible permissions and it worked.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events