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

Function buildWorklogBody

apps/sim/tools/jira/add_worklog.ts:14–26  ·  view source on GitHub ↗

* Builds the worklog request body per Jira API v3.

(params: JiraAddWorklogParams)

Source from the content-addressed store, hash-verified

12 * Builds the worklog request body per Jira API v3.
13 */
14function buildWorklogBody(params: JiraAddWorklogParams) {
15 const t = Number(params.timeSpentSeconds)
16 if (!Number.isFinite(t) || t <= 0) {
17 throw new Error('timeSpentSeconds must be a positive finite number')
18 }
19 const body: Record<string, any> = {
20 timeSpentSeconds: t,
21 comment: params.comment ? toAdf(params.comment) : undefined,
22 started: normalizeJiraWorklogTimestamp(params.started || new Date().toISOString()),
23 }
24 if (params.visibility) body.visibility = params.visibility
25 return body
26}
27
28/**
29 * Transforms a worklog API response into typed output.

Callers 2

add_worklog.tsFile · 0.70
makeRequestFunction · 0.70

Calls 2

toAdfFunction · 0.90

Tested by

no test coverage detected