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

Function transformComment

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

* Transforms a raw Jira comment object into typed output.

(comment: any)

Source from the content-addressed store, hash-verified

7 * Transforms a raw Jira comment object into typed output.
8 */
9function transformComment(comment: any) {
10 return {
11 id: comment.id ?? '',
12 body: extractAdfText(comment.body) ?? '',
13 author: transformUser(comment.author) ?? { accountId: '', displayName: '' },
14 authorName: comment.author?.displayName ?? comment.author?.accountId ?? 'Unknown',
15 updateAuthor: transformUser(comment.updateAuthor),
16 created: comment.created ?? '',
17 updated: comment.updated ?? '',
18 visibility: comment.visibility
19 ? { type: comment.visibility.type ?? '', value: comment.visibility.value ?? '' }
20 : null,
21 }
22}
23
24export const jiraGetCommentsTool: ToolConfig<JiraGetCommentsParams, JiraGetCommentsResponse> = {
25 id: 'jira_get_comments',

Callers

nothing calls this directly

Calls 2

extractAdfTextFunction · 0.90
transformUserFunction · 0.90

Tested by

no test coverage detected