Integrating a Custom HTML Questionnaire with Jira Service Management

By Ryan

Integrating a Custom HTML Questionnaire with Jira Service Management

A custom HTML questionnaire lets you collect structured answers on your own website or intranet and land every submission in Jira Service Management as a tracked request, with the full responses attached and the required answers enforced by Jira itself. The setup has three parts: the form, a small server-side function that calls the JSM REST API, and a ScriptRunner validator.

What You Gain

Before You Start

How ScaleIT handles this: See plans and pricing

Set It Up Step by Step

The work happens in four stages: build the form, create the request, attach the responses, and validate.

Stage 1: Build the questionnaire

  1. Create an HTML form with one input per question.
  2. Name each input after the JSM field it maps to, such as summary or customfield_10050.
  3. Keep questions that have no matching field in the form anyway, since Stage 3 attaches every answer.
  4. Set the form to post to your server-side endpoint.
  5. Add a browser-side required check for a smoother experience. Jira enforces the real rule in Stage 4.

Stage 2: Create the request from your server

  1. In the function, read the submitted values and map them into requestFieldValues.
  2. Send a POST to /rest/servicedeskapi/request with serviceDeskId, requestTypeId, and requestFieldValues.
  3. Add raiseOnBehalfOf with the requester's account ID so the request appears in their portal list.
  4. Authenticate with basic auth, using the service account email and the API token.
  5. Save the issueKey from the response for the next stage.
{
  "serviceDeskId": "10",
  "requestTypeId": "25",
  "requestFieldValues": {
    "summary": "New laptop questionnaire: Jordan Lee",
    "customfield_10050": "MacBook Pro"
  }
}

Stage 3: Attach the full responses

  1. Render all answers into one file, such as a PDF or a CSV.
  2. Send it as the multipart field file in a POST to /rest/servicedeskapi/servicedesk/{serviceDeskId}/attachTemporaryFile, with the headers X-Atlassian-Token: nocheck and X-ExperimentalApi: opt-in.
  3. Copy the temporary attachment ID from the response.
  4. Send a POST to /rest/servicedeskapi/request/{issueKey}/attachment with temporaryAttachmentIds and public.
  5. Set public to true so the requester sees the file, or false to keep it agent-only.
  6. Add an additionalComment if you want a note posted with the file.
  7. Open the request in the customer portal and confirm the attachment downloads.

Stage 4: Validate answers with ScriptRunner

  1. Open Jira settings → Workflows.
  2. Find the workflow for your request type, open its Actions menu, and select Edit.
  3. Select the Create transition.
  4. Select Validate details → Add validate details rule.
  5. Choose ScriptRunner Validate details using a Jira Expression, then select Select.
  6. Enter a Name for the rule.
  7. In ScriptRunner Script Validate details, enter a Jira expression such as issue.customfield_10050 != null.
  8. In Message to Show when Validation Fails, enter the message the form should show.
  9. Save the workflow.
  10. Submit a test with the answer missing and confirm the API returns the error and no request is created.

Fixing Common Errors

Who Should Own It

A managed IT partner is the natural owner for this integration, because it spans the service account, the API token, the server-side function, and the Jira workflow. They keep the field mapping current as request types change and rotate the credentials on schedule. If you already work with an IT partner, send them this guide and add the questionnaire to their scope.

ScaleIt builds and runs Jira Service Management integrations as part of managed IT support for startups and SMBs. Book a free call and we will connect your questionnaire to your service desk.

Verified against Jira Service Management Cloud REST API and ScriptRunner for Jira Cloud on 2026-10-16. Vendor docs: https://support.atlassian.com/jira/kb/how-to-add-an-attachment-to-a-jira-service-management-cloud-ticket-using-the-rest-apis/, https://support.atlassian.com/jira/kb/how-to-create-issues-with-assets-custom-field-using-jira-service-management-api, https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-request/, https://docs.adaptavist.com/sr4jc/current/features/workflow-rules/validate-details.