How-to find the correct Form ID to perform actions on a form associated to an issue.
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
You would like to use Forms API to get/submit/reopen/delete a form from Jira Automation, a third-party app, or any integration for an ISSUE.
Diagnosis
When a new form is created in JSM via Space Settings → Forms, an ID (identifier) is generated. However, when you associate this form with an issue, a new ID will be created for this association. A common error is to use the identifier from the Forms tab to get a form in an issue, and if you try that, the following error message will appear.
Request
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}A form created through Space Settings → Forms has a form-template identifier. When that form is associated with an issue, Jira Service Management creates a separate identifier for that form-on-issue association. Use the association identifier when performing actions on the form for that issue; using the identifier from the Forms tab instead can return FORM_NOT_FOUND.
Response
{
"errors": [
{
"status": 404,
"code": "FORM_NOT_FOUND",
"title": "Form Not Found",
"detail": "The provided form ID was not found.",
"context": [
{
"type": "issue",
"id": "<IssueID>"
},
{
"type": "form",
"id": "<FormID>"
}
]
}
]
}Solution
You need to get the correct form ID, which was created when you associated the form with the issue.
How do I get the correct form ID to update the form for the issue?
You need to get all the forms associated with the issue using the request below.
Request
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/formResponse
[
{
"id": "g4c5211b-0230-4d3e-aqw3-e29764377452",
"formTemplate": {
"id": "03h37dd0-r4a6-u798-hg41-3kid637fed40"
},
"internal": false,
"submitted": true,
"lock": false,
"name": "<FormName>",
"updated": "2023-06-20T18:53:48.348Z"
}
]Use the top-level id value from the response for actions on the form associated with the issue. In the example above, the form-on-issue ID is g4c5211b-0230-4d3e-aqw3-e29764377452.
The value in formTemplate.id is the global form ID. Don't substitute it for the top-level id when calling the form-on-issue request.
Request
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/g4c5211b-0230-4d3e-aqw3-e29764377452Therefore, with the above instructions you will be able to use any action provided on the
for
Forms on Issue
.
Was this helpful?