Skip to content

Commit e0e1e42

Browse files
committed
feat(workflows): Adds analysis_ready field to davis_problem workflow triggers
1 parent 310e760 commit e0e1e42

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

dynatrace/api/automation/workflows/settings/davis_problem_config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type DavisProblemConfig struct {
3131
OnProblemClose bool `json:"onProblemClose" default:"false"` //
3232
Categories *DavisProblemCategories `json:"categories"` //
3333
CustomFilter string `json:"customFilter,omitempty"` //
34+
AnalysisReady bool `json:"analysisReady" default:"false"` // If set to `true`, the workflow will only be triggered after the initial root cause analysis run is completed
3435
}
3536

3637
func (me *DavisProblemConfig) Schema(prefix string) map[string]*schema.Schema {
@@ -66,6 +67,12 @@ func (me *DavisProblemConfig) Schema(prefix string) map[string]*schema.Schema {
6667
Description: "Additional DQL matcher expression to further filter events to match",
6768
Optional: true,
6869
},
70+
"analysis_ready": {
71+
Type: schema.TypeBool,
72+
Description: "If set to `true`, the workflow will only be triggered after the initial root cause analysis run is completed",
73+
Optional: true,
74+
Default: false,
75+
},
6976
}
7077
}
7178

@@ -78,6 +85,7 @@ func (me *DavisProblemConfig) MarshalHCL(properties hcl.Properties) error {
7885
"on_problem_close": me.OnProblemClose,
7986
"categories": me.Categories,
8087
"custom_filter": me.CustomFilter,
88+
"analysis_ready": me.AnalysisReady,
8189
})
8290
}
8391

@@ -90,6 +98,7 @@ func (me *DavisProblemConfig) UnmarshalHCL(decoder hcl.Decoder) error {
9098
"on_problem_close": &me.OnProblemClose,
9199
"categories": &me.Categories,
92100
"custom_filter": &me.CustomFilter,
101+
"analysis_ready": &me.AnalysisReady,
93102
})
94103
}
95104

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
resource "dynatrace_automation_workflow" "#name#" {
2+
description = "#name#"
3+
actor = "703d65c0-4aff-45d9-8b34-2c6f5f17bb8e"
4+
owner = "703d65c0-4aff-45d9-8b34-2c6f5f17bb8e"
5+
private = true
6+
title = "#name#"
7+
tasks {
8+
}
9+
trigger {
10+
event {
11+
# active = false
12+
config {
13+
davis_problem {
14+
categories {
15+
error = false
16+
}
17+
entity_tags = {
18+
asdf = ""
19+
}
20+
entity_tags_match = "all"
21+
custom_filter = "matchesPhrase(custom.event.type, \"DEPLOY\")"
22+
analysis_ready = true
23+
}
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)