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

Function fetchIssue

apps/sim/tools/jira/retrieve.ts:253–273  ·  view source on GitHub ↗
(cloudId: string)

Source from the content-addressed store, hash-verified

251 }
252
253 const fetchIssue = async (cloudId: string) => {
254 const issueUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params.issueKey?.trim() ?? ''}?expand=renderedFields,names,schema,transitions,operations,editmeta,changelog,versionedRepresentations`
255 const issueResponse = await fetch(issueUrl, {
256 method: 'GET',
257 headers: {
258 Accept: 'application/json',
259 Authorization: `Bearer ${params.accessToken}`,
260 },
261 })
262
263 if (!issueResponse.ok) {
264 let message = `Failed to fetch Jira issue (${issueResponse.status})`
265 try {
266 const err = await issueResponse.json()
267 message = err?.message || err?.errorMessages?.[0] || message
268 } catch (_e) {}
269 throw new Error(message)
270 }
271
272 return issueResponse.json()
273 }
274
275 const fetchSupplementary = async (cloudId: string, data: any) => {
276 const base = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params.issueKey?.trim() ?? ''}`

Callers 1

retrieve.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected