Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-81845

JIRA REST API: only a single issue link can be added when editing or creating an issue

    XMLWordPrintable

Details

    Description

      So we're using JIRA's REST api to edit issues. One of the operations we've added is to create issue links (similar to how you can create issue links in JIRA when editing an issue).

      However there seems to be a limitation of only a single issue link can be added per PUT request. We are PUTing the following JSON:

      {
          "update": {
              "issuelinks": [
                  {
                      "add": {
                          "type": {
                              "name": "Blocks"
                          },
                          "inwardIssue": {
                              "key": "TEST-2345"
                          }
                      }
                  },
                  {
                      "add": {
                          "type": {
                              "name": "Blocks"
                          },
                          "inwardIssue": {
                              "key": "TEST-7001"
                          }
                      }
                  }
              ]
          },
          "fields": {},
          "properties": [],
          "historyMetadata": {}
      }

      We send a HTTP PUT https://goonbag.atlassian.net/rest/api/2/issue/TEST-7543?overrideScreenSecurity=false (for example).

      This returns a 400 error with:
      Too many operations (2) provided for field 'issuelinks'. We support at most 1 operation for this field.

      AFAICT there is no reason for this limitation. You can create multiple issue links and you can add multiple labels for example using a similar JSON as the above.

      Note

      This also applies to the issue creation via the POST /rest/api/2/issue endpoint.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              a1140f105259 andreas
              Votes:
              122 Vote for this issue
              Watchers:
              70 Start watching this issue

              Dates

                Created:
                Updated: