Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

0 votes
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"

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events