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

Function fetchAttachments

apps/sim/tools/jira/get_attachments.ts:89–109  ·  view source on GitHub ↗
(cloudId: string)

Source from the content-addressed store, hash-verified

87
88 transformResponse: async (response: Response, params?: JiraGetAttachmentsParams) => {
89 const fetchAttachments = async (cloudId: string) => {
90 const attachmentsUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params!.issueKey?.trim() ?? ''}?fields=attachment`
91 const attachmentsResponse = await fetch(attachmentsUrl, {
92 method: 'GET',
93 headers: {
94 Accept: 'application/json',
95 Authorization: `Bearer ${params!.accessToken}`,
96 },
97 })
98
99 if (!attachmentsResponse.ok) {
100 let message = `Failed to get attachments from Jira issue (${attachmentsResponse.status})`
101 try {
102 const err = await attachmentsResponse.json()
103 message = err?.errorMessages?.join(', ') || err?.message || message
104 } catch (_e) {}
105 throw new Error(message)
106 }
107
108 return attachmentsResponse.json()
109 }
110
111 let data: any
112

Callers 1

get_attachments.tsFile · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected