Hi Team,
I'm trying to write script for Jira Cloud Scriptrunner where just want to get the issues linked with the Epic.
But, I'm not able to see any linked issues result when I'm passing the Epic Key.
Any idea, what is an API which will return the linked issues to an Epic?
Please let me know if there is any query/concerns. Thanks!
Regards,
Narendra
Hi @Narendra Kumar ,
if you want to search for issues, which are in Epic with key XYZ-1, you can use field Epic Link and JQL: "Epic Link" = XYZ-1
The same JQL I would you for search for issues REST API endpoint, see here.
Thanks @Hana Kučerová for your reply.
I'm writing the below code -
def result2 = get('/rest/api/3/search?jql= Epic Link = JIR-765')
.header('Content-Type', 'application/json')
.asObject(Map)
return result2.body
But getting the below error and there is no any result -
io.github.openunirest.http.exceptions.UnirestException: java.net.URISyntaxException: Illegal character in query at index 124: https://us-west-2.in.argon.polaris.connect.product.adaptavist.com/proxy-service/rest/api/1/jira/proxy/rest/api/3/search?jql= Epic Link = JIR-765 at io.github.openunirest.request.UriFormatter.apply(UriFormatter.java:15) at io.github.openunirest.request.RequestPrep.getHttpRequest(RequestPrep.java:85) at io.github.openunirest.request.RequestPrep.prepareRequest(RequestPrep.java:29) at io.github.openunirest.request.HttpClientHelper.request(HttpClientHelper.java:29) at io.github.openunirest.request.BaseRequest.request(BaseRequest.java:92) at io.github.openunirest.request.BaseRequest.asObject(BaseRequest.java:147) at io.github.openunirest.request.BaseRequest$asObject.call(Unknown Source) at Script1.run(Script1.groovy:27) at Script1$run.call(Unknown Source) at Script1$run.call(Unknown Source) at com.adaptavist.sr.cloud.workflow.AbstractScript.evaluate(AbstractScript.groovy:33) at com.adaptavist.sr.cloud.events.ScriptExecution.run(ScriptExecution.groovy:29) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at ConsoleScriptExecution1_groovyProxy.run(Unknown Source) Caused by: java.net.URISyntaxException: Illegal character in query at index 124: https://us-west-2.in.argon.polaris.connect.product.adaptavist.com/proxy-service/rest/api/1/jira/proxy/rest/api/3/search?jql= Epic Link = JIR-765 at org.apache.http.client.utils.URIBuilder.<init>(URIBuilder.java:81) at io.github.openunirest.request.UriFormatter.apply(UriFormatter.java:13) at io.github.openunirest.request.RequestPrep.getHttpRequest(RequestPrep.java:85) at io.github.openunirest.request.RequestPrep.prepareRequest(RequestPrep.java:29) at io.github.openunirest.request.HttpClientHelper.request(HttpClientHelper.java:29) at io.github.openunirest.request.BaseRequest.request(BaseRequest.java:92) at io.github.openunirest.request.BaseRequest.asObject(BaseRequest.java:147) at io.github.openunirest.request.BaseRequest$asObject.call(Unknown Source) at Script1.run(Script1.groovy:27) at Script1$run.call(Unknown Source) at Script1$run.call(Unknown Source) at com.adaptavist.sr.cloud.workflow.AbstractScript.evaluate(AbstractScript.groovy:33) at com.adaptavist.sr.cloud.events.ScriptExecution.run(ScriptExecution.groovy:29) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at ConsoleScriptExecution1_groovyProxy.run(Unknown Source) at com.adaptavist.sr.cloud.MainHandler.executeScript(MainHandler.groovy:388) at com.adaptavist.sr.cloud.MainHandler.processInput(MainHandler.groovy:334) at com.adaptavist.sr.cloud.MainHandler.access$0(MainHandler.groovy) at com.adaptavist.sr.cloud.MainHandler$_handleRequest_closure1.doCall(MainHandler.groovy:154) at
ANy idea on this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Narendra Kumar I think the problem is there needs to quotes
/rest/api/3/search?jql="Epic Link"=JIR-765
JQL is invalid without the quotes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Hana Kučerová the above also not worked for me. Could you please check and confirm if it;s works for you?
Thank you so much for your support.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.