I have been following the docs to add some custom CSS (https://scriptrunner.adaptavist.com/latest/jira/fragments/WebResource.html).
On the "Install websource page", the Preview button returns:
<web-resource key='jira8-custom' name='ScriptRunner generated web item - jira8-custom'> <resource name='jira8-custom.css' type='download' location='jira8-custom.css' /> <context>atl.general</context> </web-resource>
which I believe implies that the jira8-custom.css file has been found in plugin.resource.directories
.
When I refresh the Active Sprints page (where I expect to see the effect of the custom CSS) nothing has changed, and I cannot find any evidence of the rules in the browsers Web Developer Tools.
Have I missed something to get this working?
EDIT:
The following options are being passed in:
-Djira.home=/home/jira
-Dplugin.resource.directories=/home/jira/scriptrunner_scripts
File is /home/jira/scriptrunner_scripts/jira8-custom.css and the jira user has read/write access.
A JIRA log suggests that the file cannot be found.
2019-11-11 13:27:26,832 http-nio-127.0.0.1-8080-exec-20 WARN anonymous 807x4991x2 10zvbih 172.18.58.203,127.0.0.1 /s/c105d797b025f536879b2e7e4f61c744-CDN/ca010b/805000/6411e0087192541a09d88223fb51a6a0/92ed8fb60806f456e655b19b4ab31a01/_/download/contextbatch/css/gh-rapid-work,gh-rapid-detailsview,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,greenhopper-rapid-non-gadget,jira.general,-_super/batch.css [webresource] error in `Content.writeTo` for com.onresolve.jira.groovy.groovyrunner:custom-css/jira8-custom.css
java.lang.RuntimeException: Cannot read resource jira8-custom.css
at com.atlassian.plugin.webresource.impl.snapshot.Resource$1.writeTo(Resource.java:204)
Installed version of Scriptrunner is 5.6.6.1-jira8, JIRA is V8.5.0
----------
It turned out that the problem was that the resources directory /home/jira/scriptrunner_scripts had been created just after the JIRA service had been started.
2019-11-07 10:33:46,824 JIRA-Bootstrap WARN [c.a.p.util.resource.AlternativeDirectoryResourceLoader] Resource directory /home/jira/scriptrunner_scripts, which resolves to /home/jira/scriptrunner_scripts does not exist
Thanks, this has helped me a lot (everything was correct, directory created, files in place, web resource well defined, preview showed correct output).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Where is your jira8-custom.css file stored relative to the jira-home?
Also, those resources are cached by your browser, so after changes, you will need to clear the cache to reload the resource with the same key.
Alternatively, you can add a suffix to your key. I like to use a date like jira8-cusom.20191111. And after refreshing the file, you can just adjust the key to the current date to force your browser to re-download.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, the file is in a subdirectory of the JIRA home. I haven't changed the file since uploading, so I don't think caching is the issue, and I have found logs that suggest it is not being found. Any idea?
-Djira.home=/home/jira
-Dplugin.resource.directories=/home/jira/scriptrunner_scripts
File is /home/jira/scriptrunner_scripts/jira8-custom.css
2019-11-11 13:27:26,832 http-nio-127.0.0.1-8080-exec-20 WARN anonymous 807x4991x2 10zvbih 172.18.58.203,127.0.0.1 /s/c105d797b025f536879b2e7e4f61c744-CDN/ca010b/805000/6411e0087192541a09d88223fb51a6a0/92ed8fb60806f456e655b19b4ab31a01/_/download/contextbatch/css/gh-rapid-work,gh-rapid-detailsview,jira.project.sidebar,atl.general,jira.global,com.atlassian.jira.projects.sidebar.init,greenhopper-rapid-non-gadget,jira.general,-_super/batch.css [webresource] error in `Content.writeTo` for com.onresolve.jira.groovy.groovyrunner:custom-css/jira8-custom.css
java.lang.RuntimeException: Cannot read resource jira8-custom.css
at com.atlassian.plugin.webresource.impl.snapshot.Resource$1.writeTo(Resource.java:204)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.