Locating WebHook URL in Service Management automation rules

Still need help?

The Atlassian Community is here for you.

Ask the community

Overview

Customers can use SM Automation in many different ways to help them achieve their desired use-case. One of the things that Automation helps is providing a way to manually trigger WebHooks within a rule's execution. Whenever this environment is refreshed to a lower environment, for instance, the configured URLs remain the same. Users in this case might want to identify which rules are making use of this functionality in order to adjust the webhooks or remove it entirely to avoid any interaction between their environments.



Solution

In larger environments, manually checking each rule can be extremely taxing. Instead, the following query should provide the needed data:

select 
thenactioncfgdata."ID",
rsetrevision."CREATED_BY" as "Rule created by",
rsetrevision."DESCRIPTION" as "Rule description",
thenactioncfgdata."CONFIG_DATA_VALUE" as "Webhook URL"
from 
"AO_9B2E3B_RULE" r
join "AO_9B2E3B_RULESET" rset on r."ID" = rset."ID"
join "AO_9B2E3B_RULESET_REVISION" rsetrevision on rsetrevision."ID" = rset."ACTIVE_REVISION_ID"
join "AO_9B2E3B_IF_THEN" ifthen on rset."ACTIVE_REVISION_ID"=ifthen."RULE_ID"
join "AO_9B2E3B_THEN_ACTION_CONFIG" thenactioncfg on thenactioncfg."IF_THEN_ID"=ifthen."ID"
join "AO_9B2E3B_THEN_ACT_CONF_DATA" thenactioncfgdata on thenactioncfg."ID"= thenactioncfgdata."THEN_ACTION_CONFIG_ID"
and thenactioncfgdata."CONFIG_DATA_KEY" ilike '%url%';

(warning) The AO_9B2E3B_THEN_ACT_CONF_DATA table contains multiple records for the same automation. This is how Service Management handles historic data for reporting purposes. The query above takes that in consideration to only show the most recent version of the automation, and thus, it's URL.

Here's a sample of how the output will be like, which can have the WebHook URL portion updated as needed:




Last modified on Apr 23, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.