Skip to content

Commit 4eec324

Browse files
committed
fix(triggers): use comment.id in JSM idempotency, fix confluence type cast
JSM extractIdempotencyId now prioritizes comment.id over issue.id for comment_created events, matching Jira's documented webhook payload structure. Also fixes type cast for confluence extract function calls.
1 parent fd7333a commit 4eec324

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

apps/sim/lib/webhooks/providers/confluence.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export const confluenceHandler: WebhookProviderHandler = {
4848
return { input: extractLabelData(body) }
4949
}
5050
if (triggerId === 'confluence_page_permissions_updated') {
51-
return { input: extractPagePermissionsData(body) }
51+
return { input: extractPagePermissionsData(body as Record<string, unknown>) }
5252
}
5353
if (triggerId === 'confluence_user_created') {
54-
return { input: extractUserData(body) }
54+
return { input: extractUserData(body as Record<string, unknown>) }
5555
}
5656
if (triggerId === 'confluence_webhook') {
5757
const b = body as Record<string, unknown>

apps/sim/lib/webhooks/providers/jsm.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,12 @@ export const jsmHandler: WebhookProviderHandler = {
8484

8585
extractIdempotencyId(body: unknown) {
8686
const obj = body as Record<string, unknown>
87+
const comment = obj.comment as Record<string, unknown> | undefined
8788
const issue = obj.issue as Record<string, unknown> | undefined
88-
const ts = obj.timestamp ?? ''
89-
if (obj.webhookEvent && issue?.id) {
90-
return `jsm:${obj.webhookEvent}:${issue.id}:${ts}`
91-
}
92-
if (obj.webhookEvent && ts) {
93-
return `jsm:${obj.webhookEvent}:${ts}`
89+
const entityId = comment?.id || issue?.id
90+
if (obj.webhookEvent && entityId) {
91+
const ts = obj.timestamp ?? ''
92+
return `jsm:${obj.webhookEvent}:${entityId}:${ts}`
9493
}
9594
return null
9695
},

0 commit comments

Comments
 (0)