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

Function fetchComments

apps/sim/tools/jira/get_comments.ts:102–125  ·  view source on GitHub ↗
(cloudId: string)

Source from the content-addressed store, hash-verified

100
101 transformResponse: async (response: Response, params?: JiraGetCommentsParams) => {
102 const fetchComments = async (cloudId: string) => {
103 const startAt = params?.startAt ?? 0
104 const maxResults = params?.maxResults ?? 50
105 const orderBy = params?.orderBy ?? '-created'
106 const commentsUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params!.issueKey?.trim() ?? ''}/comment?startAt=${startAt}&maxResults=${maxResults}&orderBy=${orderBy}`
107 const commentsResponse = await fetch(commentsUrl, {
108 method: 'GET',
109 headers: {
110 Accept: 'application/json',
111 Authorization: `Bearer ${params!.accessToken}`,
112 },
113 })
114
115 if (!commentsResponse.ok) {
116 let message = `Failed to get comments from Jira issue (${commentsResponse.status})`
117 try {
118 const err = await commentsResponse.json()
119 message = err?.errorMessages?.join(', ') || err?.message || message
120 } catch (_e) {}
121 throw new Error(message)
122 }
123
124 return commentsResponse.json()
125 }
126
127 let data: any
128

Callers 1

get_comments.tsFile · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected