Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-12364

JIRA REST API doesn't work when accessing a JIRA 6.1.x+ server

    XMLWordPrintable

Details

    • Unknown
    • N/A

    Description

      For example, using:

      {{velocity}}
      #set ($client = $services.jira.getJiraRestClient("http://jira.xwiki.org/"))
      #set ($pm = $services.jira.getNullProgressMonitor())
      #set ($issue = $client.getIssueClient().getIssue("XWIKI-1000", $pm))
      
      Summary: $issue.summary
      {{/velocity}}
      

      leads to:

      Caused by: com.atlassian.jira.rest.client.RestClientException: org.codehaus.jettison.json.JSONException: JSONObject["summary"] is not a JSONObject.
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:75)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:80)
      	at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:109)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173)
      	... 127 more
      Caused by: org.codehaus.jettison.json.JSONException: JSONObject["summary"] is not a JSONObject.
      	at org.codehaus.jettison.json.JSONObject.getJSONObject(JSONObject.java:458)
      	at com.atlassian.jira.rest.client.internal.json.JsonParseUtil.getNestedString(JsonParseUtil.java:116)
      	at com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:141)
      	at com.atlassian.jira.rest.client.internal.json.IssueJsonParser.parse(IssueJsonParser.java:54)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$1.call(AbstractJerseyRestClient.java:85)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
      	... 136 more
      

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: