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

Update issue link type API returning incorrect values in 200 Response

    XMLWordPrintable

Details

    Description

      Issue Summary

      The REST API for updating issue link types returns the wrong self object and the previous object prior to update, rather than the newly updated one. This forces additional REST API calls to get the updated value.

      Steps to Reproduce

      1. Create a new issue link type, e.g.
        Name: New Issue Link Type Name
        Inward: New Inward
        Outward: New Outward
        New Issue Link Type is now created with id 1052
      1. Run the following curl command
      curl --location --request PUT 'https://your-domain.atlassian.net/rest/api/3/issueLinkType/1052' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --header 'Authorization: Basic XXX' \
      --header 'Cookie: atlassian.xsrf.token=xxxxxxxx' \
      --data '{
       "name" : "Changed Issue Link Type Name",
       "inward" : "Changed Inward",
       "outward" : "Changed Outward"
      }'

      Expected Results

      Rest call to return updated issue link type and
      Self should be

      "self": "https://your-domain.atlassian.net/rest/api/3/issueLinkType/1052"  
      Response 200:
      {
          "id": "1052",
          "name" : "Changed Issue Link Type Name",
          "inward" : "Changed Inward",
          "outward" : "Changed Outward"
          "self": "https://your-site.atlassian.net/rest/api/3/issueLinkType/10152"
      } 

      Actual Results

      Response payload is the previous issue link type values and the self is incorrect: 

      "self": "https://your-site.atlassian.net/rest/api/3/issueLinkType/10152/10152"

       ID is written twice.

      Response 200:
      {
          "id": "10152",
          "name": "New Issue Link Type Name",
          "inward": "New Inward",
          "outward": "New Outward",
          "self": "https://your-site.atlassian.net/rest/api/3/issueLinkType/10152/10152"
      }

      Workaround

      Perform another Get issue link type call to get the updated values after doing the PUT call.

      Attachments

        Issue Links

          Activity

            People

              dxu@atlassian.com Daisy Xu
              26a024868f5f Sherica Ocbania
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: