feat(tools): add fields parameter to Jira search block (#4091)

* feat(tools): add fields parameter to Jira search block

Expose the Jira REST API `fields` parameter on the search operation,
allowing users to specify which fields to return per issue. This reduces
response payload size by 10-15x, preventing 10MB workflow state limit
errors for users with high ticket volume.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style(tools): remove redundant type annotation in fields map callback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tools): restore type annotation for implicit any in params callback

The params object is untyped, so TypeScript cannot infer the string
element type from .split() — the explicit annotation is required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Waleed
2026-04-09 22:45:18 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 476669fd55
commit 04c1f8e475
+17
View File
@@ -479,6 +479,13 @@ Return ONLY the JQL query - no explanations or markdown formatting.`,
placeholder: 'Maximum results to return (default: 50)',
condition: { field: 'operation', value: ['search', 'get_comments', 'get_worklogs'] },
},
{
id: 'fields',
title: 'Fields',
type: 'short-input',
placeholder: 'Comma-separated fields to return (e.g., key,summary,status)',
condition: { field: 'operation', value: 'search' },
},
// Comment fields
{
id: 'commentBody',
@@ -922,6 +929,12 @@ Return ONLY the comment text - no explanations.`,
jql: params.jql,
nextPageToken: params.nextPageToken || undefined,
maxResults: params.maxResults ? Number.parseInt(params.maxResults) : undefined,
fields: params.fields
? params.fields
.split(',')
.map((f: string) => f.trim())
.filter(Boolean)
: undefined,
}
}
case 'add_comment': {
@@ -1114,6 +1127,10 @@ Return ONLY the comment text - no explanations.`,
startAt: { type: 'string', description: 'Pagination start index' },
jql: { type: 'string', description: 'JQL (Jira Query Language) search query' },
maxResults: { type: 'string', description: 'Maximum number of results to return' },
fields: {
type: 'string',
description: 'Comma-separated field names to return (e.g., key,summary,status)',
},
// Comment operation inputs
commentBody: { type: 'string', description: 'Text content for comment operations' },
commentId: { type: 'string', description: 'Comment ID for update/delete operations' },