Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I try to hide queues using script fragments in jira service desk, but I have a problem with continuous refresh jira service desk queues list page because I can hide some queue but as the page refreshes continuously, the script's function goes into an infinite loop. I want to know if someone know alternative solution to hide queues based on user permission.
Now, my script is :
(function ($) {
var elementFound = false;
var userName = JIRA.Users.LoggedInUser.userName();
var queuesId = [];
//Call endpoint to get queues to hide
$.ajax({
url: AJS.contextPath() + "/rest/scriptrunner/latest/custom/getQueuesToHide?username=" +
userName,
type: "GET",
beforeSend: function (request) {
request.setRequestHeader("X-Atlassian-token", "no-check");
}
}).fail(function (XMLHttpRequest, textStatus, errorThrown) {
console.log("failed... look at server logs for why");
}).done(function (data) {
if(data) {
queuesId = data;
}
});
$(document).bind("DOMSubtreeModified", function(evt) {
if (elementFound)
return;
//Waiting changes in Left Grid of Queue List
if ($("#pinnednav-opts-sd-queues-nav").length > 0) {
console.log("Entramos en QUEUE grid");
var queueListObserver = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (!mutation.addedNodes) return;
var element;
for (var i in queuesId) {
element = AJS.$("[data-item-id='" + queuesId[i] + "']");
element.remove();
}
})
});
elementFound = true;
var targetQueueList;
if ($("#pinnednav-opts-sd-queues-nav").length > 0)
targetQueueList = document.getElementById("pinnednav-opts-sd-queues-nav");
queueListObserver.observe(targetQueueList, {
childList: true
, subtree: true
, attributes: false
, characterData: false
});
}
//Waiting changes in table of queue issues list
if ($("#issuetable").length > 0 ) {
var tableObserver = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (!mutation.addedNodes) {
return;
}
var element;
for (var i in queuesId) {
element = AJS.$("[data-item-id='" + queuesId[i] + "']");
element.remove();
}
})
});
var tableTarget;
if ($("#issuetable").length > 0)
tableTarget = document.getElementById("issuetable");
tableObserver.observe(tableTarget, {
childList: true
, subtree: true
, attributes: false
, characterData: false
});
}
});
})(AJS.$);
Thank's!
Ricard
Hello.
We solved that with the issue security.
The issues are mainly created via Email.
When an email comes in, we check the sender's mail address and set the Security Level automatically.
In that way the users see severall queues but they only see issues in their own queue.
BR
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.