Skip to content

Commit 1569f3f

Browse files
committed
fix alert severity logic
1 parent f051753 commit 1569f3f

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

jupiterone/client.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -947,13 +947,6 @@ def update_alert_rule(self,
947947
else:
948948
interval_config = alert_rule_config['pollingInterval']
949949

950-
# update alert severity if provided
951-
if severity is not None:
952-
action_config = alert_rule_config['operations'][0]['actions']
953-
action_config[0]['targetValue'] = severity
954-
else:
955-
action_config = alert_rule_config['operations'][0]['actions']
956-
957950
# update tags list if provided
958951
if tags is not None:
959952
if tag_op == "OVERWRITE":
@@ -984,10 +977,9 @@ def update_alert_rule(self,
984977
# update actions field inside operations payload
985978
operations[0]['actions'].extend(action_configs)
986979

987-
else:
988-
pass
989-
else:
990-
pass
980+
# update alert severity if provided
981+
if severity is not None:
982+
operations[0]['actions'][0]['targetValue'] = severity
991983

992984
variables = {
993985
"instance": {

0 commit comments

Comments
 (0)