[Automation] How do I send I include the issue link in a Slack message? How do I mention someone?

Lu April 23, 2020

Hi everyone, thanks for reading this.

I'm currently experiencing two issues with Automation (and one is probably because of my lack of experience coding with JIRA, so it's easy to respond):

1. I need to include the issue link in a Slack message sent with Automation, (and ideally in the format of PRJ-123 and the text being the link itself, though not mandatory).

I've tried this:

"Hi @[deleted] , {{issue.key}}: {{issue.IssueLink}} has been pushed to Staging. Please review it and let us know if there are issues or, if not, move it to Done. Thanks!"

And even when {{issue.key}} works fantastically {{issue.IssueLink}}, {{issue.link. IssueLink}} or {{issue.link}} do not.

 

2. In Slack, I am not actually getting a mention with the "@Lu" in the message above. It just appears as plain text. Is there a way I need to mark that is a mention in Slack? 

 

Thank you so much for your time and help!

 

 

4 answers

1 vote
brian.sarwer May 16, 2023

I had to add it like this to work:

{{issue.key}} - {{issue.summary}} - {{triggerIssue.url}}

1 vote
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 27, 2020

Hey Lu,

It's been some time but I just wanted to follow up since you've not received an answer yet. The tricky bit with @mentions is that there's no guarantee between Jira and Slack that an @handle is the same in both applications. Under the hood, both Jira and Slack use unique identifiers that have a different format.

Luckily it is possible to @mention somebody, given you know the person's Slack identifier.

First, you'll need to get the user ID from Slack (hat tip Workast):

  1. Click on a user name within Slack.
  2. Click on "View profile" in the menu that appears.
  3. Click the more icon "..."
  4. Click on "Copy Member ID."

Slack_member_ID

 

You'll need to insert this in the Automation message with the format <@U12345> - so taking your message from earlier, we'd swap out "U12345" with the value you copied from Slack:

Hi <@U12345> , {{issue.key}}: {{issue.IssueLink}} has been pushed to Staging. Please review it and let us know if there are issues or, if not, move it to Done. Thanks!

When the message is sent to Slack, the Slack client will pair it with the correct user and make that use the right @mention display name. That user gets a normal @mention in the channel (using whatever notification preference they have configured) and you get some Jira Admin success points!

Cheers,
Daniel

0 votes
Lu April 23, 2020

Yes, that works, the code now looks like this:

"Hi @[deleted], *<https://COMPANYNAME.atlassian.net/browse/{{issue.key}}|{{issue.key}}>* - "{{issue.summary}}" has been pushed to Staging..."

 

But I'm still not able to make that @[deleted] work in Slack. Ideas appreciated. Thanks in advance!

0 votes
Lu April 23, 2020

Suggest an answer

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

Atlassian Community Events