The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Collapsed Message to Slack Channel

Eric Pozzobon
Contributor
April 2, 2025

Is it possible to send a text snippet from Automation for JIRA into a slack channel?

Use Case: we are trying to send notifications when a certain team is flagged in a ticket. The notifications are working, but the descriptions for some issues can be quite verbose. I would like a way to send a specific section of the message in a collapsible section, like a text snippet, so all the main details are available "at a glance" but the long details do not fill the screen and hide the headline details.

Any ideas?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jitin Chugh
Community Champion
April 2, 2025
Please note that I've taken assistance from GenAI tools to update this response.
  • Use Slack's "blocks" format to structure the message.

  • Use a "section" block for high-level details.

  • Use a "context" block or "fields" to add metadata.

  • Use a "divider" to separate sections.

  • Use a "blockquote" (>) or "code block" (```) for the detailed description.

Example: Jira Automation Rule

  1. Trigger: When a ticket is flagged for a specific team.

  2. Action: Send message to Slack using "Send Slack message" action.

  3. Slack Message Format (JSON Payload in Advanced Mode)

 

 

  • Main details (Issue Key, Summary, Priority, Status)

    • These are visible at a glance.

  • Key Details

    • If you have a specific section of the description (like a summary field), you can extract it.

  • Collapsible Section

    • The full description is enclosed in a code block (```) so it takes less space and can be expanded in Slack.

  • Modify the below JSON to match your Jira fields.

  • Use "Advanced" mode in Jira Automation's Send Slack message action.

 

{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*🚩 Flagged Ticket Alert!*\n*<${issue.url}|${issue.key} - ${issue.summary}>*"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*Priority:* ${issue.priority} | *Status:* ${issue.status}"
}
]
},
{
"type": "divider"
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*📌 Key Details:*\n${issue.customfield_12345}" // Replace with the field ID for your custom summary
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*💬 Full Description (click to expand):*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "``` ${issue.description} ```"
}
}
]
}

 

 

Eric Pozzobon
Contributor
April 4, 2025

@Jitin Chugh Thanks for the reply!

A couple points of clarification, I do not see anywhere to convert the "Slack Message Format" to a JSON payload in the Slack component, is the intent to use a web callout here?

Secondly, still fiddling with the syntax in the Web Callout, its giving me a bad request when I try to send it as a web callout.

Am I missing something in your reply? Thanks in advance!

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events