* Transforms an add comment API response into typed output.
(data: any, params: JiraAddCommentParams)
| 7 | * Transforms an add comment API response into typed output. |
| 8 | */ |
| 9 | function 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 | |
| 22 | export const jiraAddCommentTool: ToolConfig<JiraAddCommentParams, JiraAddCommentResponse> = { |
| 23 | id: 'jira_add_comment', |
no test coverage detected