(cloudId: string, params: JiraListProjectsParams)
| 22 | } |
| 23 | |
| 24 | function buildSearchUrl(cloudId: string, params: JiraListProjectsParams): string { |
| 25 | const queryParams = new URLSearchParams() |
| 26 | // `lead` is not returned by default on project/search — expand it so the lead outputs populate. |
| 27 | queryParams.append('expand', 'lead') |
| 28 | if (params.query) queryParams.append('query', params.query) |
| 29 | if (params.startAt !== undefined) queryParams.append('startAt', String(params.startAt)) |
| 30 | if (params.maxResults !== undefined) queryParams.append('maxResults', String(params.maxResults)) |
| 31 | const queryString = queryParams.toString() |
| 32 | return `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/project/search${queryString ? `?${queryString}` : ''}` |
| 33 | } |
| 34 | |
| 35 | export const jiraListProjectsTool: ToolConfig<JiraListProjectsParams, JiraListProjectsResponse> = { |
| 36 | id: 'jira_list_projects', |
no test coverage detected