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

Special Char not working with "GET /rest/api/2/issue/{issueIdOrKey}" anymore

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Able to get results when I call directly from web browser:

      https://jiracielo.atlassian.net/rest/api/3/search?jql=project%20in%20(CRD,%20%22Squad%20Farol%22,%20%22Squad%20Apollo%20(APP)%22,%20%22Squad%20Rentabilidade%22,%20%22Harley%20Davidson%20(Squad%20HD)%22,%20%22Venda%20de%20Solu%C3%A7%C3%B5es%20de%20Captura%22,%20%22SQUAD%20-%20Pr%C3%A9-Pago%22,%20SIGOTRIX,%20%22Squad%20POS%202018%22)%20AND%20issuetype%20in%20(Block,%20Risk,%20kaizen,%20Incident)%20OR%20project%20=%20SSWET%20AND%20%22Frente%20de%20Entrega%22%20in%20(%22Star%20Trek%22,%20%22Star%20Wars%22)%20AND%20issuetype%20in%20(Block,%20Risk,%20kaizen,%20Incident)&startAt=0&maxResults=100

       

      But when I try to call via GET from my application, I receive the error:

      <!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><p><b>Exception</b></p><pre>java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 39861) Erro  na obtenção de de dados :  <!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1><hr class="line" /><p><b>Type</b> Exception Report</p><p><b>Message</b> Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986</p><p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).</p><p><b>Exception</b></p><pre>java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:467) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:294) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.lang.Thread.run(Thread.java:748)</pre><p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p><hr class="line" /><h3>Apache Tomcat/9.0.10</h3></body></html>

       

      It used to be working last Friday (September 14th). Below you can see how do we call the Rest Service. 

       

       

      query = project in (CRD, "Squad Farol", "Squad Apollo (APP)", "Squad Rentabilidade", "Harley Davidson (Squad HD)", "Venda de Soluções de Captura", "SQUAD - Pré-Pago", SIGOTRIX, "Squad POS 2018") AND issuetype in (Block, Risk, kaizen, Incident) OR project = SSWET AND "Frente de Entrega" in ("Star Trek", "Star Wars") AND issuetype in (Block, Risk, kaizen, Incident)

      servidor = https://jiracielo.atlassian.net

       I identified in bold the text that cause de error. When I remove both, the GET service return code 200. If there is any special char in the query, the error return code 400.

      Public Function GetIssues(query As String) As String

      Dim JiraService As New MSXML2.XMLHTTP60
      Dim json As Object
      Dim s As String
      Dim Servidor As String

      Servidor = (Range("Jira_Server").Value)
      vrLimPagina = 100
      With JiraService
      s = Servidor + "/rest/api/2/search?jql=" + query + "&startAt=" + CStr(vrCursor) + "&maxResults=" + _
      CStr(vrLimPagina) + "&fields=*all"
      .Open "GET", s
      .setRequestHeader "Content-Type", "application/json"
      .setRequestHeader "Accept", "application/json"
      .setRequestHeader "Authorization", "No Auth"
      .send

      If .Status = "404" Then
      fStatus.AppendStatus ("Erro ao conectar no Jira, : " + .responseText)
      GetIssues = ""
      Else
      If .Status = "200" Then
      fStatus.AppendStatus ("Conexão realizada com sucesso")
      GetIssues = JiraService.responseText
      Else
      fStatus.AppendStatus ("Erro na obtenção de de dados : " + .responseText)
      GetIssues = ""
      End If
      End If
      End With

      End Function

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            a4cf26a2fb1c Ricardo da Silva Camara
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: