Slack channel hyperlink in automation message

Maciej Cielec
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!
July 25, 2023

Hey guys,

 

So what I would like to achieve is to have a Slack channel hyperlinked in automation message sent to another Slack channel. In general the message should look like: 

 

You can find more details in this channel: #channel_name_here. 

 

Whole #channel_name_here is taken from custom field in Jira, so I did {{issue.customfield_id}}, but it sends the channel name as normal text, it's not hyperlinked in blue. Goal is to have this hyperlinked so you can get sent to the channel easily when you tap on in, instead of browsing through channels looking for this one. 

Is this achievable in any way? 

Channel exists already, so I thought it will automatically pick-up the hyperlink, but seems like it doesn't. 

Any ideas? or workarounds?

1 answer

1 accepted

1 vote
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 25, 2023

Hi @Maciej Cielec , welcome to the Community!

The body of Slack messages in Automation rules uses Slack's app surface formatting. For links to public channels , it will use the ID. This is separate from the channel name - click through for instructions on Slack if this isn't what's already in your custom field. The example they give in the documentation of the ID format is C024BE7LR.

So - once you've got the channel id in a custom field (not the channel name!), you can call it in the body of your Slack message automation action like this:

You can find more details in this channel: <#{{issue.customfield_id.text}}>. 

Two things are happening that I'd like to call attention to - 

  1. The channel ID is surrounded by < > characters. This is what tells Slack that object is a channel (or user) ID and to format it as a link when it is posted in Slack
  2. I've used the .text operator on the end of your custom field to ensure the text value of whatever custom field type that is turns out to be what is passed into the message.


Cheers!
Daniel

Suggest an answer

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

Atlassian Community Events