How-to find the correct Form ID to perform actions on a form associated to an issue.

 

プラットフォームについて: Cloud のみ - この記事は クラウド プラットフォームのアトラシアン製品に適用されます。

要約

You would like to use Forms API to get/submit/reopen/delete a form from Jira Automation, third-party app, or any integration for an ISSUE

環境

  • Jira Service Management Cloud
  • This article references the OAuth 2.0 (3LO) method which calls the api.atlassian.com domain.  See Authentication and authorization for how that URL can change depending on which authorization being used.

診断

When a new form is created in JSM via Project SettingsForms, an ID (identifier) will be created. 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.

リクエスト
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/{formId}
レスポンス
{
  "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>"
        }
      ]
    }
  ]
}

ソリューション

You need to get the correct form ID which was created when you associated the form with the issue.

How to get the correct form ID to update the form on the issue?

You need to get all the forms associated with the issue using the below request.

リクエスト
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form
レスポンス
[
    {
        "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"
    }
]

So, for the current scenario, the ID that must be used to update a form associated with the issue is: "g4c5211b-0230-4d3e-aqw3-e29764377452". The ID inside of the "formTemplate" element "03h37dd0-r4a6-u798-hg41-3kid637fed40" is the global form ID. Using the following request, you would be able to perform any action on the form associated with the issue.

リクエスト
https://api.atlassian.com/jira/forms/cloud/{cloudId}/issue/{issueIdOrKey}/form/g4c5211b-0230-4d3e-aqw3-e29764377452
Therefore, with the above instructions you will be able to use any action provided on the API Form documentation for Forms on Issue.

Last modified on Mar 25, 2025

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.