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

Function makeRequest

apps/sim/tools/jira/add_worklog.ts:136–158  ·  view source on GitHub ↗
(cloudId: string)

Source from the content-addressed store, hash-verified

134 }
135
136 const makeRequest = async (cloudId: string) => {
137 const worklogUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params!.issueKey?.trim() ?? ''}/worklog`
138 const worklogResponse = await fetch(worklogUrl, {
139 method: 'POST',
140 headers: {
141 Accept: 'application/json',
142 'Content-Type': 'application/json',
143 Authorization: `Bearer ${params!.accessToken}`,
144 },
145 body: JSON.stringify(buildWorklogBody(params!)),
146 })
147
148 if (!worklogResponse.ok) {
149 let message = `Failed to add worklog to Jira issue (${worklogResponse.status})`
150 try {
151 const err = await worklogResponse.json()
152 message = err?.errorMessages?.join(', ') || err?.message || message
153 } catch (_e) {}
154 throw new Error(message)
155 }
156
157 return worklogResponse.json()
158 }
159
160 let data: any
161

Callers 1

add_worklog.tsFile · 0.70

Calls 2

joinMethod · 0.80
buildWorklogBodyFunction · 0.70

Tested by

no test coverage detected