Skip to content

Commit 3bf9337

Browse files
committed
fix(jsm): add formTemplateId validation and conditional required on formAnswers
1 parent 37152fd commit 3bf9337

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

apps/sim/app/api/tools/jsm/forms/attach/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export async function POST(request: NextRequest) {
5151
return NextResponse.json({ error: issueIdOrKeyValidation.error }, { status: 400 })
5252
}
5353

54+
const formTemplateIdValidation = validateJiraCloudId(formTemplateId, 'formTemplateId')
55+
if (!formTemplateIdValidation.isValid) {
56+
return NextResponse.json({ error: formTemplateIdValidation.error }, { status: 400 })
57+
}
58+
5459
const baseUrl = getJsmFormsApiBaseUrl(cloudId)
5560
const url = `${baseUrl}/issue/${encodeURIComponent(issueIdOrKey)}/form`
5661

apps/sim/blocks/blocks/jira_service_management.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Return ONLY the description text - no explanations.`,
356356
type: 'long-input',
357357
placeholder:
358358
'JSON object using form question IDs as keys (e.g., {"1": {"text": "Title"}, "4": {"choices": ["5"]}, "14": {"text": "Details"}})',
359-
mode: 'advanced',
359+
required: { field: 'operation', value: 'save_form_answers' },
360360
condition: { field: 'operation', value: ['create_request', 'save_form_answers'] },
361361
},
362362
{

0 commit comments

Comments
 (0)