feat(jsm): add ProForma/JSM Forms discovery tools#4078
Conversation
Add three new tools for discovering and inspecting JSM Forms (ProForma) templates
and their structure, enabling dynamic form-based workflows:
- jsm_get_form_templates: List form templates in a project with request type bindings
- jsm_get_form_structure: Get full form design (questions, layout, conditions, sections)
- jsm_get_issue_forms: List forms attached to an issue with submission status
All endpoints validated against the official Atlassian Forms REST API OpenAPI spec.
Uses the Forms Cloud API base URL (jira/forms/cloud/{cloudId}) with X-ExperimentalApi header.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates the JSM integration surface area by wiring these operations into the block UI/params mapping, tool registry/index, and shared Reviewed by Cursor Bugbot for commit 39b276b. Configure here. |
Greptile SummaryThis PR adds three new JSM Forms (ProForma) discovery tools — Confidence Score: 5/5This PR is safe to merge — all previously flagged security and duplication issues have been resolved in follow-up commits. All three new tools follow established JSM patterns consistently. Input validation is applied before URL construction in every route. The shared No files require special attention.
|
| Filename | Overview |
|---|---|
| apps/sim/app/api/tools/jsm/forms/templates/route.ts | New API route for listing form templates; input validation and shared error parser are properly applied. |
| apps/sim/app/api/tools/jsm/forms/structure/route.ts | New API route for fetching form structure; both projectIdOrKey and formId are validated before use. |
| apps/sim/app/api/tools/jsm/forms/issue/route.ts | New API route for listing issue forms; follows same validation pattern as existing JSM routes. |
| apps/sim/tools/jsm/utils.ts | Added getJsmFormsApiBaseUrl, getJsmHeaders, and parseJsmErrorMessage as shared utilities; proper extraction from the three route files. |
| apps/sim/tools/jsm/types.ts | Added FORM_TEMPLATE_PROPERTIES, ISSUE_FORM_PROPERTIES, interfaces and response types for the three new tools; new union members added to JsmResponse. |
| apps/sim/blocks/blocks/jira_service_management.ts | Three new dropdown options added; projectIdOrKey and formId subBlocks properly conditioned; new params cases in tools.config are complete and consistent. |
| apps/sim/tools/jsm/index.ts | Barrel export updated with three new tool exports. |
| apps/sim/tools/registry.ts | Three new tool entries registered correctly. |
Sequence Diagram
sequenceDiagram
participant UI as Block UI
participant Exec as Executor
participant Route as API Route
participant Val as Input Validation
participant Atlassian as Atlassian Forms API
UI->>Exec: operation = get_form_templates / get_form_structure / get_issue_forms
Exec->>Route: POST /api/tools/jsm/forms/{templates|structure|issue}
Route->>Val: validateJiraCloudId(cloudId)
Route->>Val: validateJiraIssueKey(projectIdOrKey) or validateJiraIssueKey(issueIdOrKey)
Route->>Val: validateJiraCloudId(formId) [structure only]
Val-->>Route: validation result
Route->>Atlassian: GET /project/{key}/form [templates]
Route->>Atlassian: GET /project/{key}/form/{id} [structure]
Route->>Atlassian: GET /issue/{key}/form [issue forms]
Atlassian-->>Route: FormTemplateIndexEntry[] / FormDesign / FormIndexEntry[]
Route-->>Exec: { success, output: { templates|design|forms, total } }
Exec-->>UI: rendered output
Reviews (3): Last reviewed commit: "chore(jsm): remove unused FORM_QUESTION_..." | Re-trigger Greptile
- Add validateJiraIssueKey for projectIdOrKey in templates and structure routes - Add validateJiraCloudId for formId (UUID) in structure route - Extract parseJsmErrorMessage to shared utils.ts (was duplicated across 3 routes) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
Dead code — the get_form_structure tool passes the raw design object through as JSON, so this output constant had no consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 39b276b. Configure here.
* feat(jsm): add ProForma/JSM Forms discovery tools
Add three new tools for discovering and inspecting JSM Forms (ProForma) templates
and their structure, enabling dynamic form-based workflows:
- jsm_get_form_templates: List form templates in a project with request type bindings
- jsm_get_form_structure: Get full form design (questions, layout, conditions, sections)
- jsm_get_issue_forms: List forms attached to an issue with submission status
All endpoints validated against the official Atlassian Forms REST API OpenAPI spec.
Uses the Forms Cloud API base URL (jira/forms/cloud/{cloudId}) with X-ExperimentalApi header.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(jsm): add input validation and extract shared error parser
- Add validateJiraIssueKey for projectIdOrKey in templates and structure routes
- Add validateJiraCloudId for formId (UUID) in structure route
- Extract parseJsmErrorMessage to shared utils.ts (was duplicated across 3 routes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* chore(jsm): remove unused FORM_QUESTION_PROPERTIES constant
Dead code — the get_form_structure tool passes the raw design object
through as JSON, so this output constant had no consumers.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Summary
jsm_get_form_templates,jsm_get_form_structure,jsm_get_issue_formscreate_requestwithformAnswersNew Tools
jsm_get_form_templatesGET /project/{projectIdOrKey}/formjsm_get_form_structureGET /project/{projectIdOrKey}/form/{formId}jsm_get_issue_formsGET /issue/{issueIdOrKey}/formFiles Changed
apps/sim/app/api/tools/jsm/forms/{templates,structure,issue}/route.tsapps/sim/tools/jsm/get_form_{templates,structure}.ts,get_issue_forms.tsTest plan
jsm_get_form_templatesreturns form template index entries for a projectjsm_get_form_structurereturns full FormDesign with questions, layout, conditionsjsm_get_issue_formsreturns form index entries for an issueprojectIdOrKeyandformIdinputs appear/hide correctly based on operation