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

Function buildWorklogBody

apps/sim/tools/jira/update_worklog.ts:12–32  ·  view source on GitHub ↗
(params: JiraUpdateWorklogParams)

Source from the content-addressed store, hash-verified

10import type { ToolConfig } from '@/tools/types'
11
12function buildWorklogBody(params: JiraUpdateWorklogParams) {
13 let timeSpentSeconds: number | undefined
14 if (
15 params.timeSpentSeconds !== undefined &&
16 params.timeSpentSeconds !== null &&
17 String(params.timeSpentSeconds).trim() !== ''
18 ) {
19 const n = Number(params.timeSpentSeconds)
20 if (!Number.isFinite(n) || n <= 0) {
21 throw new Error('timeSpentSeconds must be a positive finite number')
22 }
23 timeSpentSeconds = n
24 }
25 const body: Record<string, any> = {
26 timeSpentSeconds,
27 comment: params.comment ? toAdf(params.comment) : undefined,
28 started: params.started ? normalizeJiraWorklogTimestamp(params.started) : undefined,
29 }
30 if (params.visibility) body.visibility = params.visibility
31 return body
32}
33
34function transformWorklogResponse(data: any, params: JiraUpdateWorklogParams) {
35 return {

Callers 1

update_worklog.tsFile · 0.70

Calls 2

toAdfFunction · 0.90

Tested by

no test coverage detected