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

ScriptRunner WebResource doesn't work

Gleb Kartashov September 2, 2020

Hi!

I have Jira Server runnig as service on my server. Scriptrunner documentation says modify your setenv.sh (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:

image.png

Script file contents:

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

(also from documentation page)

Install WebResource page looks ok:

image.png

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

What might be the problem here?

1 answer

0 votes
Mathis Hellensberg
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2020

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

Gleb Kartashov September 4, 2020

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

Gleb Kartashov September 8, 2020

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
TAGS
AUG Leaders

Atlassian Community Events