Skip to content

Commit c939f8a

Browse files
waleedlatif1claude
andauthored
fix(jira): add explicit fields parameter to search/jql endpoint (#3544)
The GET /rest/api/3/search/jql endpoint requires an explicit `fields` parameter to return issue data. Without it, only the issue `id` is returned with all other fields empty. This adds `fields=*all` as the default when the user doesn't specify custom fields. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0b19ad0 commit c939f8a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

apps/sim/tools/jira/search_issues.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ export const jiraSearchIssuesTool: ToolConfig<JiraSearchIssuesParams, JiraSearch
137137
if (params.nextPageToken) query.set('nextPageToken', params.nextPageToken)
138138
if (typeof params.maxResults === 'number')
139139
query.set('maxResults', String(params.maxResults))
140-
if (Array.isArray(params.fields) && params.fields.length > 0)
140+
if (Array.isArray(params.fields) && params.fields.length > 0) {
141141
query.set('fields', params.fields.join(','))
142+
} else {
143+
query.set('fields', '*all')
144+
}
142145
const qs = query.toString()
143146
return `https://api.atlassian.com/ex/jira/${params.cloudId}/rest/api/3/search/jql${qs ? `?${qs}` : ''}`
144147
}
@@ -159,8 +162,11 @@ export const jiraSearchIssuesTool: ToolConfig<JiraSearchIssuesParams, JiraSearch
159162
if (params?.jql) query.set('jql', params.jql)
160163
if (params?.nextPageToken) query.set('nextPageToken', params.nextPageToken)
161164
if (typeof params?.maxResults === 'number') query.set('maxResults', String(params.maxResults))
162-
if (Array.isArray(params?.fields) && params.fields.length > 0)
165+
if (Array.isArray(params?.fields) && params.fields.length > 0) {
163166
query.set('fields', params.fields.join(','))
167+
} else {
168+
query.set('fields', '*all')
169+
}
164170
const searchUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/search/jql?${query.toString()}`
165171
const searchResponse = await fetch(searchUrl, {
166172
method: 'GET',

0 commit comments

Comments
 (0)