Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

REST endpoint - can't create using script on disk

Hi there,


Jira 7.12.3, ScriptRunner 5.4.45


trying to create a REST endpoint using ScriptRunner for Jira, and observing the following behavior:

1) all is ok when inline script is used
2) when I want to use file on disk, it creates an endpoint I want with the code from this file (with the name, say, "projects/endpoints/dialog1/endpoint.groovy" and a cog next to it), AND another endpoint named "dialog1.groovy" with no cog and comment "Found by class scanning and can't be edited here" instead.

I can't access the REST endpoint at all since the automatically configured one takes precedence and causes the following error:

2019-01-02 09:23:17,617 http-nio-8080-exec-26 ERROR s.kachanovskiy 563x44088x1 ks0owv,0:0:0:0:0:0:0:1 /rest/scriptrunner/latest/custom/showDialog [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Cannot open URL: bundle://178.0:0/endpoint.groovy
groovy.util.ResourceException: Cannot open URL: bundle://178.0:0/endpoint.groovy
        at groovy.util.GroovyScriptEngine.getResourceConnection(
        at groovy.util.GroovyScriptEngine.loadScriptByName(
        at groovy.util.GroovyScriptEngine$loadScriptByName$ Source)
        at com.onresolve.scriptrunner.runner.ScriptRunnerImpl.loadScriptByName(ScriptRunnerImpl.groovy:692)
        ... 2 filtered
        at java.lang.reflect.Method.invoke(
        ... 19 filtered
        ... 1 filtered
        ... 41 filtered
        at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(
        ... 53 filtered
        ... 1 filtered
        ... 16 filtered
        ... 19 filtered
        at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(
        ... 10 filtered
        at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(
        ... 4 filtered
        at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(
        ... 26 filtered
        at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(
        ... 24 filtered
        at java.util.concurrent.ThreadPoolExecutor.runWorker(
        at java.util.concurrent.ThreadPoolExecutor$
        at org.apache.tomcat.util.threads.TaskThread$
Caused by: groovy.util.ResourceException: Cannot open URL: file:/var/atlassian/application-data/jira/scripts/endpoint.groovy
        at groovy.util.GroovyScriptEngine.getResourceConnection(
        ... 236 more

deleting the "long name" endpoint also deletes the other one.

to me it looks like for some reason I cannot configure an endpoint using an arbitrary file.


any ideas/suggestions here?


2 answers

Check if package defined in script.
Looks like it's working WITHOUT package while inline, but as file script it needs a package.
Works for me.

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Jan 02, 2019

Where is it getting "bundle://178.0:0/endpoint.groovy" from?  That's a broken url, so it's never going to work.

it's indeed broken.


I've tested it again using example from here: (well - I've actually used this example to create my own code :))

the result is exactly the same: it creates TWO endpoints, one with a cog and the other from class scanning, both with the same resource names, auto-configured one is used first, and log records say file "/var/atlassian/application-data/jira/scripts/example.groovy" cannot be found (it is intentionally placed under subfolder).

Like Rolf Lader likes this

there's one thing that actually kind of moves it forward:

when I start my endpoint script with package declaration, all is fine: a single endpoint is created, name is ok, and it immediately works no matter how deep in subfolders I put the file.

now I am wondering if this is the recommended (or maybe the sole?) workaround, and if it is - what is the root cause of such behavior, and should I go through all scripts I have for postfunctions/conditions/validators and put the same package declaration line on top? and do I get i right that the package declaration reflects the folder structure, so that if I have condition, validator and postfunction scripts for transition in the same folder, they all are going to have the same package declaration line?


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events