Forums

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

Send webhook to slack via JMWE

Tarieli Gvritishvili
Contributor
April 8, 2024

Hello,

I want to send a slack message with webhook from JMWE app like it is in Jira native automation on a certain trigger.

How is it possible to post the webhook.

2 answers

1 accepted

2 votes
Answer accepted
Avinash Bhagawati _Appfire_
Community Champion
April 9, 2024

Hi @Tarieli Gvritishvili Good day!

In this case, you can use a Build-your-own (JMWE app) post-function, and use the callRest filter: https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465242995/callRest 

Please find below example.

{% set payload = {
"channel": "#test-001",
"username": "webhookbot",
"text": "This is posted for #test-001 and comes from a bot named webhookbot.",
"icon_emoji": ":ghost:"
} %}

{% set webhook_url = "https://hooks.slack.com/services/T013H6GS22J/XXXXXX/XXXXXXXXXXoBJutA185uAWF" %}

{{ webhook_url | callRest(verb="post", body=payload) | dump(2) }}

I hope this helps! 

BTW, I'm from Appfire, the vendor of JMWE app. 

Thanks,
Avinash

Tarieli Gvritishvili
Contributor
April 10, 2024

Works great, thanks a lot.

Jocelyn Weber
July 3, 2024

Is it possible to call issue fields into the body of the text? This is working well except that it is showing "... for {{issue.fields.customfield_10100}} was transitioned..." in the body of the slack message instead of the value of that field. 

David Fischer
Community Champion
July 3, 2024

It is, but not using {{}} since you're building a string, not the output. So you would do:

"text":"for "+issue.fields.customfield_10100+" was transitioned"
İclal Aslan
Contributor
October 16, 2024

@Avinash Bhagawati _Appfire_  hello

how can i send the new assignee information? I have been triyng assignee.displayName but wont work

Rodrigo Brito
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!
November 30, 2024

Very good!

Thanks for the help. I managed to make it work here for me.

For anyone who wants to use the model I used, just use the one below:

 

{% set payload = {
"channel": "#name-channel",
"text": "🚨 The card *{{issue.key}} - {{issue.summary}}* has just been created! \n\n- *Status*: {{issue.status.name}} \n- *Card Link*: <https://zenvia.atlassian.net/browse/{{issue.key}}> \n- *Issue Type*: {{issue.issueType.name}} \n- *Priority*: {{issue.priority.name}} \n\nPlease review and take action as soon as possible. :white_check_mark:"
} %}

{% set webhook_url = "https://hooks.slack.com/services/YOUR/WEBHOOK/HERE" %}

{{ webhook_url | callRest(verb="post", body=payload) }}

It worked like a charm!! 🤩🤩

Like Tarieli Gvritishvili likes this
0 votes
Daniel McVay
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 14, 2026

Wanted to contribute because this article helped a lot. Our org uses a lot of Slack reports that go out to the teams. Important to note that I'm using Scheduled Actions and setting my target issue to a singular issue because JMWE will send per each issue within the JQL. 

So here are two different cases that we were able to whip up. I hope this helps anyone being forced to switch to cloud. 

SLACK Reporter Boilerplate - No Alert When Null

{% set issues = "filter in 'test filter'" | searchIssues(maxResults=5, fields="summary,updated") %}

{# #channel name #}

{% set webhook_url = "https://hooks.slack.com/services/YOUR/WEBHOOK/HERE" %}

{% set baseUrl = "baseUrl" | serverInfo %}

{% if issues | length > 0 %}

{% set message = "" %}

{% for issue in issues %}

{% set message = message + "<" + baseUrl + "/browse/" + issue.key + "|" + issue.fields.summary + ">\n" %}{% endfor %}

{% set payload = {

    "blocks": [

        {

            "type": "header",

            "text": { "type": "plain_text", "text": "Daily Report" }

        },

        { "type": "divider" },

        {

            "type": "section",

            "text": { "type": "mrkdwn", "text": message }

        }

    ]

} %}

{{ webhook_url | callRest(verb="post", body=payload) | dump(2) }}

{% endif %}

SLACK Reporter BoilerPlate - Alert When Null2026-07-14 10_52_58-Solarity Health Cloud Migration Project - Empyra - Weekly Sync - Meeting Occurre.png2026-07-14 10_54_39-Emails - File Explorer.png

{% set issues = "filter in 'test filter'" | searchIssues(maxResults=5, fields="summary,updated") %}

{# #channel name #}

{% set webhook_url = "https://hooks.slack.com/services/YOUR/WEBHOOK/HERE" %}

{% set baseUrl = "baseUrl" | serverInfo %}

{% if issues | length > 0 %}

{% set message = "" %}

{% for issue in issues %}

{% set message = message + "<" + baseUrl + "/browse/" + issue.key + "|" + issue.key + "> — " + issue.fields.summary + " — " + (issue.fields.updated | date("DD/MMM/YY HH:mm")) + "\n" %}

{% endfor %}

{% set payload = {

    "blocks": [

        {

            "type": "header",

            "text": { "type": "plain_text", "text": "Daily Report" }

        },

        { "type": "divider" },

        {

            "type": "section",

            "text": { "type": "mrkdwn", "text": message }

        }

    ]

} %}

{% else %}

{% set payload = {

    "blocks": [

        {

            "type": "header",

            "text": { "type": "plain_text", "text": "Daily Report" }

        },

        { "type": "divider" },

        {

            "type": "section",

            "text": { "type": "mrkdwn", "text": "No issues found :white_check_mark:" }

        }

    ]

} %}

{% endif %}

{{ webhook_url | callRest(verb="post", body=payload) | dump(2) }}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events