Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

The built-in template "Post to a channel when a webhook request is received" does not seem to work

(0) ShareShare
ReportReport
Posted on by 2
after using the built-in template "Post to a channel when a webhook request is received" I get an error after testing the Workflow by sending a webhook POOST with Python.
 
 
This is the script I am using although I have redacted the complete URL:
 
import requests
import json

# Define the Jira webhook URL
webhook_url = 'https://prod-86.westeurope.logic.azure.com:443/<...REDACTED...>'

# Sample payload to simulate a Jira webhook event
# Customize the payload according to the expected data structure
payload = {
    "timestamp": "2024-10-23T10:00:00Z",
    "webhookEvent": "jira:issue_updated",
    "issue": {
        "id": "10001",
        "key": "PROJECT-123",
        "fields": {
            "summary": "Test Issue Summary",
            "status": {
                "name": "In Progress"
            },
            "assignee": {
                "displayName": "John Doe"
            }
        }
    },
    "user": {
        "name": "user_name",
        "emailAddress": "user@example.com",
        "displayName": "User Full Name"
    }
}

# Optional headers (if your webhook requires authentication or specific content type)
headers = {
    'Content-Type': 'application/json',
    # 'Authorization': 'Bearer your_token_if_required'
}

# Send POST request to Jira webhook
try:
    response = requests.post(webhook_url, headers=headers, data=json.dumps(payload))
    
    # Check response status
    if response.status_code == 200:
        print("Webhook test successful!")
        print(f"Response: {response.text}")
    else:
        print(f"Failed to trigger webhook. Status code: {response.status_code}")
        print(f"Response: {response.text}")

except requests.exceptions.RequestException as e:
    print(f"An error occurred: {e}")
Is there something wrong with the template? Or is there something wrong with my script?
  • Suggested answer
    wobY Profile Picture
    2 on at
    The built-in template "Post to a channel when a webhook request is received" does not seem to work
    Hey there, I was having issues with this as well as the documentation for these is basically non-existent but I've figured it out. Here's what you need to do.
     
    Step 1:
    The body of the request needs to be in the below format:
    {
           "type":"message",
           "attachments":[
              {
                 "contentType":"application/vnd.microsoft.card.adaptive",
                 "contentUrl":null,
                 "content":{
                    "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
                    "type":"AdaptiveCard",
                    "version":"1.2",
                    "body":[
                        {
                        "type": "TextBlock",
                        "text": "For Samples and Templates, see [https://adaptivecards.io/samples](https://adaptivecards.io/samples)"
                        }
                    ]
                 }
              }
           ]
        }
     
    Step 2:
    You can use the Adaptive Cards Designer to create your Adaptive card: https://adaptivecards.microsoft.com/designer
     
    Then just replace the "content" JSON with your Adaptive Card JSON you created in the Designer. 
     
    Example:
    {
      "type": "message",
      "attachments": [
        {
          "contentType": "application/vnd.microsoft.card.adaptive",
          "contentUrl": null,
          "content": {
            "type": "AdaptiveCard",
            "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
            "version": "1.5",
            "body": [
              {
                "type": "TextBlock",
                "text": "**🤖 Test subject**",
                "wrap": true
              },
              {
                "type": "TextBlock",
                "text": "Test text here",
                "wrap": true
              }
            ]
          }
        }
      ]
    }
     
    Step 3 (if necessary):
    Additionally, if Flow bot is not in the channel you can switch the "Post as" to be "User" and then it will post the message as the user who create the Workflow

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492