Skip to content

Commit 733fefc

Browse files
waleedlatif1claude
andcommitted
fix(rootly): send empty body on resolve_alert, guard assignedToUserId parse
resolve_alert now sends { data: {} } instead of undefined when no optional params are provided, matching the acknowledge_alert fix. create_action_item now validates assignedToUserId is numeric before parseInt to avoid silent NaN coercion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3c373a0 commit 733fefc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

apps/sim/tools/rootly/create_action_item.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export const rootlyCreateActionItemTool: ToolConfig<
8585
if (params.kind) attributes.kind = params.kind
8686
if (params.priority) attributes.priority = params.priority
8787
if (params.status) attributes.status = params.status
88-
if (params.assignedToUserId) attributes.assigned_to_user_id = Number(params.assignedToUserId)
88+
if (params.assignedToUserId) {
89+
const numericId = Number.parseInt(params.assignedToUserId, 10)
90+
if (!Number.isNaN(numericId)) attributes.assigned_to_user_id = numericId
91+
}
8992
if (params.dueDate) attributes.due_date = params.dueDate
9093
return { data: { type: 'incident_action_items', attributes } }
9194
},

apps/sim/tools/rootly/resolve_alert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const rootlyResolveAlertTool: ToolConfig<
4949
if (params.resolutionMessage) attributes.resolution_message = params.resolutionMessage
5050
if (params.resolveRelatedIncidents !== undefined)
5151
attributes.resolve_related_incidents = params.resolveRelatedIncidents
52-
if (Object.keys(attributes).length === 0) return undefined
52+
if (Object.keys(attributes).length === 0) return { data: {} }
5353
return { data: { type: 'alerts', attributes } }
5454
},
5555
},

0 commit comments

Comments
 (0)