Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JSWCLOUD-10333

Updating epic link field through REST causes 500 Internal Error

      Was raised as part of a support ticket.
      This seems to be caused because the EpicLinkCFType returns an IssueImpl object, which at the side of JIRA gets casted to a String (which throws an exception) (see TextCustomFieldOperationsHandler.getInitialValue()).
      It's considered to be a TextCustomFieldOperationsHandler because of this check in CustomFieldImpl:

      public RestFieldOperationsHandler getRestFieldOperation()
          {
              CustomFieldType customFieldType = getCustomFieldType();
              if (customFieldType instanceof RestCustomFieldTypeOperations)
              {
                  return ((RestCustomFieldTypeOperations) customFieldType).getRestFieldOperation(this);
              }
              return new TextCustomFieldOperationsHandler(this, getI18nHelper());
          }
      

          Form Name

            [JSWCLOUD-10333] Updating epic link field through REST causes 500 Internal Error

            Jas Panesar added a comment - - edited

            Appears fixed as per status of this ticket, trying out!

            Jas Panesar added a comment - - edited Appears fixed as per status of this ticket, trying out!

            Bob Swift added a comment - - edited

            I believe this fixed caused JSW-13830 since this was about the only thing in 6.7.14.

            Bob Swift added a comment - - edited I believe this fixed caused JSW-13830 since this was about the only thing in 6.7.14.

            The workarounds do not work (Jira 7.0.10). Please help, very annoyed with this.

            Martin Tints added a comment - The workarounds do not work (Jira 7.0.10). Please help, very annoyed with this.

            Marek Pazik (Inactive) added a comment - - edited

            Marek Pazik (Inactive) added a comment - - edited There is workaround for this issue. The public REST Api provides resources that do equivalent work: https://docs.atlassian.com/greenhopper/REST/cloud/#agile/1.0/epic-moveIssuesToEpic https://docs.atlassian.com/greenhopper/REST/cloud/#agile/1.0/epic-removeIssuesFromEpic

            Hi pals,
            any update on this issue ?

            Harinder Singh added a comment - Hi pals, any update on this issue ?

            Tim Thompson added a comment - - edited

            Well ain't this a bummer. It seems that it has been working all along; however, the MSXML2.XMLHTTP returns a status of 1223 (Unknown) instead of a valid 204 "no content" and so Excel VBA craps out. Took a lot of digging, but stumbled across a note stating

            "XMLHTTPRequest implementation in MSXML HTTP (...) does not handle HTTP responses with status code 204 (No Content) properly; the `status' property has the value 1223.".

            I just ignore the error and the world is fine. No content is exactly what is expected back and ONLY a successful SEND would cause the error because no content is returned.

            Thanks Douglas - your workaround is now working for me. Still would like to see a proper fix for the JIRA REST API handling of the EPIC LINK field.

            Tim Thompson added a comment - - edited Well ain't this a bummer. It seems that it has been working all along; however, the MSXML2.XMLHTTP returns a status of 1223 (Unknown) instead of a valid 204 "no content" and so Excel VBA craps out. Took a lot of digging, but stumbled across a note stating "XMLHTTPRequest implementation in MSXML HTTP (...) does not handle HTTP responses with status code 204 (No Content) properly; the `status' property has the value 1223.". I just ignore the error and the world is fine. No content is exactly what is expected back and ONLY a successful SEND would cause the error because no content is returned. Thanks Douglas - your workaround is now working for me. Still would like to see a proper fix for the JIRA REST API handling of the EPIC LINK field.

            As far as I can tell everything is setup correctly. I have several other transactions working (GETs, POSTs) - this seems to be
            1. Known Atlassian EPIC LINK issue through the published API.
            2. ALTERNATE APPROACH - /greenhopper: Some weird thing going on in VBA with the MSXML2.XMLHTTP object in it's parsing of a JSON object with array structure "[ ...]". If I remove the array "[....]" it goes through and I get the expected JIRA-side error response.

            I think I'm cursed.

            Tim Thompson added a comment - As far as I can tell everything is setup correctly. I have several other transactions working (GETs, POSTs) - this seems to be 1. Known Atlassian EPIC LINK issue through the published API. 2. ALTERNATE APPROACH - /greenhopper: Some weird thing going on in VBA with the MSXML2.XMLHTTP object in it's parsing of a JSON object with array structure "[ ...]". If I remove the array " [....] " it goes through and I get the expected JIRA-side error response. I think I'm cursed.

            are your authentication headers setup correctly?

            I don't know VBA at all, so I wouldn't be much help here

            Douglas Orttenburger added a comment - are your authentication headers setup correctly? I don't know VBA at all, so I wouldn't be much help here

            NOTE TO ATLASSIAN: You've got 32 votes and 25 watchers on this issue - you sure it's "minor"?

            Tim Thompson added a comment - NOTE TO ATLASSIAN: You've got 32 votes and 25 watchers on this issue - you sure it's "minor"?

            Tim Thompson added a comment - - edited

            Been hitting a brick wall with the VBA's MSXML2.XMLHTTP object. Here's my code:

            Sub testEPIC()
            Dim objHTTP2 As New MSXML2.XMLHTTP
            baseURL = "https://<mydomain>/"

            httpCMD = "PUT"
            epicKEY = "MCID-472"
            storyKEY = "MCID-417"
            httpURL = baseURL + "rest/greenhopper/1.0/epics/" + epicKEY + "/add"
            httpSEND = "

            {""ignoreEpics"": true, ""issueKeys"": [ """ + storyKEY + """]}

            "

            objHTTP2.Open httpCMD, httpURL, False
            objHTTP2.setRequestHeader "Content-Type", "application/json"
            objHTTP2.setRequestHeader "Accept", "application/json"
            objHTTP2.setRequestHeader "Set-Cookie", httpCOOKIE ' set by previous login
            objHTTP2.send httpSEND
            End Sub

            So I know this works for other GETs/PUTs/POSTs when using the ".../rest/api/latest/" related URLs; however this never makes it out of VBA.
            The httpSEND of the JSON string

            { "ignoreEpics": true, "issueKeys": [ "MCID-417" ] }

            craps out with a VBA error:
            Run-time error "=2147467259 (80004005)':
            Unspecified error
            ...yet I've successfully sent other JSON strings via the same mechanism. Oh, and cut/paste the same string into a browser REST api works too.

            Anybody any ideas?

            Tim Thompson added a comment - - edited Been hitting a brick wall with the VBA's MSXML2.XMLHTTP object. Here's my code: Sub testEPIC() Dim objHTTP2 As New MSXML2.XMLHTTP baseURL = "https://<mydomain>/" httpCMD = "PUT" epicKEY = "MCID-472" storyKEY = "MCID-417" httpURL = baseURL + "rest/greenhopper/1.0/epics/" + epicKEY + "/add" httpSEND = " {""ignoreEpics"": true, ""issueKeys"": [ """ + storyKEY + """]} " objHTTP2.Open httpCMD, httpURL, False objHTTP2.setRequestHeader "Content-Type", "application/json" objHTTP2.setRequestHeader "Accept", "application/json" objHTTP2.setRequestHeader "Set-Cookie", httpCOOKIE ' set by previous login objHTTP2.send httpSEND End Sub So I know this works for other GETs/PUTs/POSTs when using the ".../rest/api/latest/" related URLs; however this never makes it out of VBA. The httpSEND of the JSON string { "ignoreEpics": true, "issueKeys": [ "MCID-417" ] } craps out with a VBA error: Run-time error "=2147467259 (80004005)': Unspecified error ...yet I've successfully sent other JSON strings via the same mechanism. Oh, and cut/paste the same string into a browser REST api works too. Anybody any ideas?

              Unassigned Unassigned
              jderaedt Jeroen De Raedt
              Affected customers:
              70 This affects my team
              Watchers:
              49 Start watching this issue

                Created:
                Updated:
                Resolved: