Skip to content

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

Merged
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/jira-search-fields-param
Apr 10, 2026
Merged

feat(tools): add fields parameter to Jira search block#4091
waleedlatif1 merged 3 commits intostagingfrom
waleedlatif1/jira-search-fields-param

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

@waleedlatif1 waleedlatif1 commented Apr 10, 2026

Summary

  • Exposes the Jira REST API fields query parameter on the Search Issues operation
  • Users can now specify a comma-separated list of fields (e.g., key,summary,status,priority) to return only what they need
  • Fully backwards compatible — when omitted, all fields are returned (existing behavior)

Motivation

Users with moderate-to-high ticket volume hit the 10MB workflow execution state limit because the search returns 21+ fields per issue. The fields parameter reduces per-issue payload by 10-15x (e.g., ~2-3KB → ~200 bytes), keeping workflows well under the limit.

Changes

  • apps/sim/blocks/blocks/jira.ts: Added fields subBlock (short-input, search operation only), wired through tools.config.params (splits comma string → array), added to block inputs definition
  • The search tool (tools/jira/search_issues.ts) already had full fields support — no tool changes needed

Test plan

  • Set operation to "Search Issues" and verify the Fields input appears
  • Enter key,summary,status and run — verify only those fields are returned
  • Leave Fields empty and run — verify all fields are returned (backwards compat)
  • Verify fields with spaces like key, summary, status are trimmed correctly

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 <[email protected]>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 10, 2026 5:40am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 10, 2026

PR Summary

Low Risk
Low risk: adds an optional input and parameter mapping for Jira search, without changing auth, write operations, or defaults when omitted.

Overview
Adds a new optional Fields input to the Jira block’s Search Issues operation, allowing callers to request only a comma-separated subset of Jira issue fields.

Wires this value through the block’s tool params by parsing the string into a trimmed string array and updates the block inputs schema accordingly; when omitted, search behavior remains unchanged.

Reviewed by Cursor Bugbot for commit 987f723. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 10, 2026

Greptile Summary

This PR exposes the Jira REST API fields query parameter on the Search Issues operation by adding a fields subBlock to jira.ts, splitting the comma-separated user input into an array in tools.config.params, and adding the input definition. The change is backwards compatible — omitting fields continues to request *all fields from Jira, and the underlying search tool already accepted a fields array param. The split/trim/filter pipeline correctly handles empty strings and whitespace-only input.

Confidence Score: 5/5

Safe to merge — change is backwards compatible with no risk of regressions.

Single-file change with a clear, contained scope. Edge cases (empty string, whitespace-only, undefined) are all handled correctly. The one P2 observation is an informational gap about output schema behaviour, not a correctness issue.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/jira.ts Adds fields subBlock (search-only, short-input) and wires it through tools.config.params with split/trim/filter logic, plus adds the input definition — straightforward and backwards compatible.

Sequence Diagram

sequenceDiagram
    participant User
    participant JiraBlock as Jira Block (jira.ts)
    participant Tool as jiraSearchIssuesTool
    participant JiraAPI as Jira REST API

    User->>JiraBlock: Enter fields (e.g. "key,summary,status")
    JiraBlock->>JiraBlock: split(',').map(trim).filter(Boolean) → ["key","summary","status"]
    JiraBlock->>Tool: params.fields = ["key","summary","status"]
    Tool->>JiraAPI: GET /search/jql?fields=key,summary,status
    JiraAPI-->>Tool: Reduced payload (~200 bytes/issue)
    Tool->>Tool: transformSearchIssue() → fixed output shape (missing fields default to "" or null)
    Tool-->>JiraBlock: { issues: [...], ... }
    JiraBlock-->>User: Block output
Loading

Reviews (3): Last reviewed commit: "fix(tools): restore type annotation for ..." | Re-trigger Greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e40021d. Configure here.

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 <[email protected]>
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 987f723. Configure here.

@waleedlatif1 waleedlatif1 merged commit 04c1f8e into staging Apr 10, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/jira-search-fields-param branch April 10, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant