for an external gadget I am workin on I need to submit a jql query to our jira host, which sits in another domain from the confluence box where the gadget will run
using the method defined here where an application link is used for cross domain ajax requests between confluence and jira, I have setup the code to properly query the jira host for simple api requests
where my problem begins is when i need to perform a jql search and the parameters are quoted
( decoded : jql=project=epdc+and+fixVersion+in+(\"Version 1.0\") )
i get the following error from the confluence rest api:
java.lang.IllegalArgumentException: Illegal character in query at index 108: http://jira.example.com/http://jira.example.com/rest/api2/search?jql=project=epdc+and+fixVersion+in+(\"Version 1.0\")
at java.net.URI.create(Unknown Source)
as a side note...the query works fine when run directly against the jira host in a browser
So.....
I need to be able to submit complex jql across the application link, but i cannot wrap my head around how to get the quoted content to pass through the confluence rest api for the application link
Any ideas?
Community moderators have prevented the ability to post new answers.
so far my only recourse is to force users to save a jql filter in jira and then leverage that in the gadget application instead of allowing "in gadget" jql construction
Charles:
I made the adjustment to the url and removed the escapes ... still yileds the crash:
(decoded params: search?jql=project=epdc+and+fixVersion="Version 1.0")
Result:
java.lang.IllegalArgumentException: Illegal character in query at index 77: http://jira.example.com/rest/api/2/search?jql=project=epdc+and+fixVersion="Version 1.0"
at java.net.URI.create(Unknown Source)
caused by: java.net.URISyntaxException: Illegal character in query at index 77: http://jira.example.com/rest/api/2/search?jql=project=epdc+and+fixVersion="Version 1.0"
at java.net.URI$Parser.fail(Unknown Source)
java.lang.IllegalArgumentException: Illegal character in query at index 77: http://jira.example.com/rest/api/2/search?jql=project=epdc+and+fixVersion="Version 1.0" at java.net.URI.create(Unknown Source) at com.atlassian.sal.core.net.HttpClientProtocolConfig.changeHostConfigurationProtocol(HttpClientProtocolConfig.java:44) at com.atlassian.sal.core.net.HttpClientProtocolConfig.configureProtocol(HttpClientProtocolConfig.java:21) at com.atlassian.sal.core.net.HttpClientRequestFactory.configureProtocol(HttpClientRequestFactory.java:85) at com.atlassian.sal.core.net.HttpClientRequestFactory.getHttpClient(HttpClientRequestFactory.java:56) at com.atlassian.sal.core.net.HttpClientRequestFactory.createRequest(HttpClientRequestFactory.java:45) at com.atlassian.sal.core.net.HttpClientRequestFactory.createRequest(HttpClientRequestFactory.java:17) at sun.reflect.GeneratedMethodAccessor897.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131) at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this is still an outstanding problem.. I cannot submit jql to jira through the application link via REST api where the JQL contains special charcters such as quotes...any one have any ideas how to resolve this problem?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kevin,
I seem to be having the same problem as you. Did you ever fix this?
Steve
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had to force the users to craft their JQL in jira and save it. Then I built an interface in my plugin that allowed them to do a search by filter ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. I feared that was the only workaround.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I can see two problems here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.