Locating WebHook URL in Service Management automation rules

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

概要

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.

ソリューション

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:



To retrieve the list of webhook URLs defined in the Legacy automation rule, along with the assigned JSM project name, execute the query below:

select
thenactioncfgdata."ID",
rsetrevision."CREATED_BY" as "Rule created by",
rsetrevision."DESCRIPTION" as "Rule description",
thenactioncfgdata."CONFIG_DATA_VALUE" as "Webhook URL",
proj."pname" as "Projet Name"
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"
join "AO_9B2E3B_RSETREV_PROJ_CONTEXT" projcontext on projcontext."RULESET_REVISION_ID"=rsetrevision."ID"
join "project" proj on proj."id"=projcontext."PROJECT_ID"
and thenactioncfgdata."CONFIG_DATA_KEY" ilike '%url%';

Here is an example illustrating the format of the output, which may present the WebHook URL alongside the corresponding JSM project Name:

最終更新日 2024 年 11 月 7 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.