Content webhooks with space property conditions do not work

A webhook with the following setup will cause app install to fail with the error “Installation failed. The app includes a Webhook module with an unsupported condition (space_property_equal_to).”

   "webhooks": [
      {
        "event": "page_created",
        "url": "/rest/webhook/page/page_created",
        "conditions": [
                  {
                    "condition": "space_property_equal_to",
                    "params": {
                      "propertyKey": "app_prop_name",
                      "objectName": "key",
                      "value": "true"
                    }
                  }
        ]
      }
    ]

Meanwhile, the following setup will install fine, but the condition will always resolve to false.

   "webhooks": [
      {
        "event": "page_created",
        "url": "/rest/webhook/page/page_created",
        "conditions": [
                  {
                    "condition": "entity_property_equal_to",
                    "params": {
                      "entity": "space",
                      "propertyKey": "app_prop_name",
                      "objectName": "key",
                      "value": "true"
                    }
                  }
        ]
      }
    ]

Is this a bug? Is there a known workaround?

1 Like

Hi @jason,

I’ve reproduced this and it seems like a bug so I’ve created CONFCLOUD-70385.

Regards,
Dugald

2 Likes

@jason @dmorrow this isn’t a bug. I was confirming with the ecosystem engineering team yesterday that Conditions in webhooks for Confluence Cloud is not supported.

@jason, @dmorrow as what @rwhitbeck mentioned, conditions isn’t officially supported in Confluence Cloud yet. They’ve been somewhat added recently to support some very specific internal use-case, but we can’t guarantee which ones works and which doesn’t. Here’s the feature request on adding conditions to webhooks: https://ecosystem.atlassian.net/browse/AC-1824

Ok, that’s unfortunate, but thanks for the response @rtalusan @rwhitbeck and @dmorrow. It’s great to get quick followup on this.

In the documentation for the Confluence webhook module, filtering is mentioned, but oddly JQL is referenced rather than CQL. Can I do what I want with filtering instead? Our initial testing of this was not promising.

That page has a lot of mixed documentation with Jira so I’m sure that’s adding to the confusion. I’ll bring this up with the documentation team.