Send webhook to slack via JMWE

Tarieli Gvritishvili 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.

1 answer

1 accepted

1 vote
Answer accepted
Avinash Bhagawati _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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 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 Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events