Skip to main content

case_project_rules

Creates, updates, deletes, gets or lists a case_project_rules resource.

Overview

Namecase_project_rules
TypeResource
Iddatadog.service_management.case_project_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringAutomation rule identifier. (example: e6773723-fe58-49ff-9975-dff00f14e28d)
attributesobjectCore attributes of an automation rule, including its name, trigger condition, action to execute, and current state.
relationshipsobjectRelated resources for the automation rule, including the users who created and last modified it.
typestringJSON:API resource type for case automation rules. (rule) (default: rule, example: rule)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_case_automation_ruleselectproject_id, rule_idReturns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled).
list_case_automation_rulesselectproject_idReturns all automation rules configured for a project. Automation rules allow automatic actions to be triggered by case events like creation, status transitions, or attribute changes.
create_case_automation_ruleinsertproject_id, dataCreates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute.
update_case_automation_rulereplaceproject_id, rule_id, dataUpdates the trigger, action, name, or state of an existing automation rule.
delete_case_automation_ruledeleteproject_id, rule_idPermanently deletes an automation rule from a project.
disable_case_automation_ruleexecproject_id, rule_idDisables an automation rule so it no longer triggers on case events. The rule configuration is preserved.
enable_case_automation_ruleexecproject_id, rule_idEnables a previously disabled automation rule so it triggers on matching case events.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
project_idstringThe UUID of the project that owns the automation rules. (example: e555e290-ed65-49bd-ae18-8acbfcf18db7)
rule_idstringThe UUID of the automation rule. (example: e6773723-fe58-49ff-9975-dff00f14e28d)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Returns a single automation rule identified by its UUID, including its trigger, action, and current state (enabled/disabled).

SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.case_project_rules
WHERE project_id = '{{ project_id }}' -- required
AND rule_id = '{{ rule_id }}' -- required
;

INSERT examples

Creates an automation rule for a project. The rule defines a trigger event (for example, case created, status transitioned) and an action to execute.

INSERT INTO datadog.service_management.case_project_rules (
data,
project_id
)
SELECT
'{{ data }}' /* required */,
'{{ project_id }}'
RETURNING
data
;

REPLACE examples

Updates the trigger, action, name, or state of an existing automation rule.

REPLACE datadog.service_management.case_project_rules
SET
data = '{{ data }}'
WHERE
project_id = '{{ project_id }}' --required
AND rule_id = '{{ rule_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Permanently deletes an automation rule from a project.

DELETE FROM datadog.service_management.case_project_rules
WHERE project_id = '{{ project_id }}' --required
AND rule_id = '{{ rule_id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

Disables an automation rule so it no longer triggers on case events. The rule configuration is preserved.

EXEC datadog.service_management.case_project_rules.disable_case_automation_rule
@project_id='{{ project_id }}' --required,
@rule_id='{{ rule_id }}' --required
;