Slack integration
Power Scripts enables you to connect Jira with Slack and send automated messages from Jira to your Slack channels. This setup lets you notify team members about Jira ticket activities such as new tickets, updates, comments, or status changes without manual intervention.
SIL scripts define the message content and specify when messages are sent. The connection supports Slack's formatting options including text styling, attachments, and color-coding to make your notifications more readable and organized.
Prerequisites
Before setting up the integration, ensure you have:
Administrator permissions in your Jira instance.
Access to create and manage Slack apps in your workspace. You can contact your Slack administrator to request permissions.
Basic understanding of Jira workflows and transitions.
Familiarity with JSON structures. This is helpful, but not required.
Procedure
To configure your Slack integration follow these steps:
Step 1: Obtain a Slack API token |
For security reasons, in cloud environments, the Slack access token is only visible at the time of creation and cannot be viewed again later. Make sure to store it securely elsewhere in case you need it again. |
---|---|
Step 2: Create a Slack integration in Power Scripts |
You can read more about internal integrations in Slack's API documentation. |
Prepare for implementation
Before creating SIL scripts that send messages to Slack, you need to:
Identify the target Slack channels for your notifications.
Learn the structure of Slack messages and attachments.
Understand how to reference Jira issue data in your messages.
How to find your Slack channel ID
To send messages to a specific Slack channel, you need the channel's ID.
Open Slack in your browser and navigate to the channel you want to use.
Look at the URL in your browser's address bar. It looks something like:
https://app.slack.com/client/T12345678/C12345678
The channel ID is the part after the team ID; it starts withC
followed by alphanumeric characters.
About message structure
SIL provides predefined structures for creating Slack messages:
Structure name | Field | Type |
|
---|---|---|---|
JSlackMessage | channel | string |
|
text | string |
| |
attachments | JSlackAttachment[] |
| |
JSlackAttachment | pretext | string |
|
fallback | string |
| |
title | string |
| |
title_link | string |
| |
text | string |
| |
color | string |
|
Implementation example
The following example demonstrates how to use the Slack integration with Jira through SIL scripts. It shows how to create a Slack message with multiple attachments, different colors, and various text formatting styles. The first attachment demonstrates pretext and bold/strikethrough formatting, while the second attachment showcases code formatting with a different color scheme. This approach is useful for creating visually distinct sections in your notifications or for highlighting different types of information within a single message.
JSlackAttachment att1;
att1.pretext = "Optional text that appears above the attachment block";
att1.title = "This is an example of attachment ...";
att1.text = "*Bold* ~strike~ text";
att1.color = "#4286f4";
JSlackAttachment att2;
att2.title = "This is an example of attachment with code.";
att2.text = "`var i = 0; doSomethingWith(i);`";
att2.color = "#f45641";
JSlackMessage message;
message.channel = "C9S2LC24T";
message.text = "Test slack message with attachment...";
message.attachments = {att1, att2};
return sendIntegrationMessage("SLACK", message);
More configuration guides
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.