0

I've been using Jira automation to trigger various activities in Slack.

For example.

  1. Set up a new Slack channel, using conversations.create, to set up a new public channel with a name based on the Jira issue's key (#issue-ABC-1234).
  2. Send a message to another, existing Slack channel to notify that the new channel has been set up.

The json for step 2 looks something like this.


> {
>    "channel":  "#existing-slack-channel",
>              "text": "@channel
>              {{issue.summary}} has just been created
Join channel #issue-{{issue.key}}",
>              "link_names": true
> }

The message looks like this

@channel New Issue has just been created. Join channel #issue-ABC-1234

This has been working just fine for months. The new channel name appeared in Slack as a hyperlink. This made it easy for people to see the message and join the new channel.

We recently moved to a new Slack instance and since then the channel name in the message created by step 2 is now plain text.

Tried the following...

Checked to make sure the json hasn't changed. Checked to make sure the new channel is properly set up by step 1, before moving to step 2. Tried various formats for the message, markdown, plain text. Tried wrapping the message in a block.

In all cases, the channel name in the message remains in plain text.

1 Answers1

0

Looks like they changed #text handling on the UI, when you are sending a #text plaintext in chat.postMessage it does not work for me too. However Slack client do a proper substitution and posts a rich_text/rich_text_section block element to a server.

Please, use the linking described in Linking to public channels section of their formatting manual; the canonical way of linking for a channel was always as <#channel_id|channel_name>, as I remember, however now there is no info on channel_name part (as I remember, this part was ignored, but the channel ID is still needed for proper channel linking), so <#channel_id> is fine:

Why not join <#C024BE7LR>?

And similar for users but <@user_id>:

Hey <@U024BE7LH>, thanks for submitting your report.

However, be aware, the link to a public channel will be visible to everybody, but the link to a private channel will be visible only to members of that channel, all non-members will get a Private channel banner instead. If you should refer to a private channel, you should post its name as plaintext without links only (or try to link it with http link or something from https://api.slack.com/reference/deep-linking).

If you also play with sending messages in browser (per my experience browser API calls are handled mostlly the same as bot/user token based) with a browser console and look for conversations.history responses for the channel you'll also found they also respond with following plaintext:

  • #channel_name is displayed as plain text #channel_name.
  • <#channel_id|channel_name> is displayed as a link to a public channel.
  • <#channel_id|> is displayed as a link to a private channel.

Perhaps, they use |channel_name for some optimizations, have no idea.

Vadym Nekhai
  • 131
  • 5