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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

ScriptRunner WebResource doesn't work


I have Jira Server runnig as service on my server. Scriptrunner documentation says modify your (or .bat) in order to add resource dir. For service-type installation I've guessed I had to edit service properties and added same line into Java options in server properties window:


Script file contents:

(function ($) {
$(function () {
AJS.dialog2.on("show", function (e) {
var targetId =;
if (targetId == "sr-dialog") {
var someDialog = AJS.dialog2(;
$("#dialog-ok-button").click(function (e) {
// etc

(also from documentation page)

Install WebResource page looks ok:


But nothing happens when I click OK button in that dialog window?

What might be the problem here?

1 answer

From what I can see you have set it up correctly. Have you checked for errors in the browser console? :)

Browser console is empty. No reactions on clicking ok-button

Also now (for some reason) dialog window does not show up anymore. Instead there is browser console error:

Uncaught TypeError: Cannot read property 'hasAttribute' of undefined
at String.<anonymous> (batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508)
at Function.each (batch.js?locale=en-US:43)
at batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508
at new r (batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508)
at Object.dialog2 (batch.js?locale=en-US:319)
at Object.<anonymous> (batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:76100)
at c (batch.js?locale=en-US:54)
at Object.fireWith [as resolveWith] (batch.js?locale=en-US:54)
at u (batch.js?locale=en-US:54)
at XMLHttpRequest.<anonymous> (batch.js?locale=en-US:54)
(anonymous) @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508
each @ batch.js?locale=en-US:43
(anonymous) @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508
r @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:4508
(anonymous) @ batch.js?locale=en-US:319
(anonymous) @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:76100
c @ batch.js?locale=en-US:54
fireWith @ batch.js?locale=en-US:54
u @ batch.js?locale=en-US:54
(anonymous) @ batch.js?locale=en-US:54
load (async)
send @ batch.js?locale=en-US:54
ajax @ batch.js?locale=en-US:54
u @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:76100
(anonymous) @ batch.js?baseurl-check-resources=true&healthcheck-resources=true&jira.create.linked.issue=true&locale=en-US&richediton=true&user-logged-in=true:76100
dispatch @ batch.js?locale=en-US:54
v.handle @ batch.js?locale=en-US:54

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

Why upgrade to Jira Service Management Premium?

We often have questions from folks using Jira Service Management about the benefits to using Premium. Check out this video to learn how you can unlock even more value in our Premium plan.  &nb...

170 views 0 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you