MCPcopy Index your code
hub / github.com/simstudioai/sim / transformCommentResponse

Function transformCommentResponse

apps/sim/tools/jira/add_comment.ts:9–20  ·  view source on GitHub ↗

* Transforms an add comment API response into typed output.

(data: any, params: JiraAddCommentParams)

Source from the content-addressed store, hash-verified

7 * Transforms an add comment API response into typed output.
8 */
9function transformCommentResponse(data: any, params: JiraAddCommentParams) {
10 return {
11 ts: new Date().toISOString(),
12 issueKey: params.issueKey ?? 'unknown',
13 commentId: data?.id ?? 'unknown',
14 body: data?.body ? (extractAdfText(data.body) ?? params.body ?? '') : (params.body ?? ''),
15 author: transformUser(data?.author) ?? { accountId: '', displayName: '' },
16 created: data?.created ?? '',
17 updated: data?.updated ?? '',
18 success: true,
19 }
20}
21
22export const jiraAddCommentTool: ToolConfig<JiraAddCommentParams, JiraAddCommentResponse> = {
23 id: 'jira_add_comment',

Callers 1

add_comment.tsFile · 0.85

Calls 2

extractAdfTextFunction · 0.90
transformUserFunction · 0.90

Tested by

no test coverage detected