Skip to content

Commit

Permalink
Fixed #579
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinhard-Pilz-Dynatrace committed Nov 6, 2024
1 parent d0c07b5 commit af13e5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dynatrace/api/automation/workflows/settings/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ func (me *Task) MarshalHCL(properties hcl.Properties) error {
}
inputJSON = opt.NewString(string(data))
}
// Fix for #579. The REST API apparently now produces an empty `conditions` property
// That leads to non-empty plans
if me.Conditions != nil {
if me.Conditions.Custom == nil && me.Conditions.Else == nil && len(me.Conditions.States) == 0 {
me.Conditions = nil
}
}
return properties.EncodeAll(map[string]any{
"name": me.Name,
"action": me.Action,
Expand Down

0 comments on commit af13e5e

Please sign in to comment.