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

Function resolveProjectKey

apps/sim/tools/jira/bulk_read.ts:58–69  ·  view source on GitHub ↗
(cloudId: string, accessToken: string, ref: string)

Source from the content-addressed store, hash-verified

56 const PAGE_SIZE = 100
57
58 const resolveProjectKey = async (cloudId: string, accessToken: string, ref: string) => {
59 const refTrimmed = (ref || '').trim()
60 if (!refTrimmed) return refTrimmed
61 const url = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/project/${encodeURIComponent(refTrimmed)}`
62 const resp = await fetch(url, {
63 method: 'GET',
64 headers: { Authorization: `Bearer ${accessToken}`, Accept: 'application/json' },
65 })
66 if (!resp.ok) return refTrimmed
67 const project = await resp.json()
68 return project?.key || refTrimmed
69 }
70
71 const resolveCloudId = async () => {
72 if (params?.cloudId) return params.cloudId

Callers 1

bulk_read.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected