Skip to main content

At least for our (internal) use we struggle to see the purpose of the additional page that shows up when we click “Place request” on a service item. We do not want our requesters to be able to change the email address of the requester, and they rarely (never) have the need to place a request on behalf of someone else.

Is there a way to skip that page?

I’ve achieved this using jQuery. Below is the relevant code from our deployment; add to the Footer file within Service Desk Rebranding.

<script>
$(document).ready(function(){
function applyCustomizations() {

// Check if the URL contains '/catalog/'
if(window.location.href.includes('/catalog/')) {
//Check if confirm request exists and, if so, click
if ($('#confirm-request').length > 0) {
$('#confirm-request').click();
}
}

}

// Apply customizations initially
applyCustomizations();

// Apply customizations every 1 seconds
setInterval(applyCustomizations, 1000);
});
</script>

 


That worked well, thank you very much!


Can this be applied to specific service items? 

We are ok with users (admins) requesting on behalf of someone else, but not for licensed software service items.


Can this be applied to specific service items? 

We are ok with users (admins) requesting on behalf of someone else, but not for licensed software service items.

Yes, but depending on the number of catalog items your approach may differ. You could target it in different ways:

1) Based on the name of the user, so if they’re an admin the code doesn’t apply to them. This would require an identifier within their name (i.e. Firstname Lastname tAdmin]).

<script>
$(document).ready(function(){
function applyCustomizations() {

// Code that will be skipped if the name contains tAdmin]
if ($(".user-profile-info span").text().indexOf("eAdmin]") !== -1) {
// Check if the URL contains '/catalog/'
if(window.location.href.includes('/catalog/')) {
// Check if confirm request exists and, if so, click
if ($('#confirm-request').length > 0) {
$('#confirm-request').click();
}
}
}

}

// Apply customizations initially
applyCustomizations();

// Apply customizations every 1 seconds
setInterval(applyCustomizations, 1000);
});
</script>

2) Based on the item ID in the URL (/support/catalog/items/1) - in this instance, IDs 1, 22, 54 are excluded.

<script>
$(document).ready(function(){
var excludedCatalogItemIds = I1, 22, 54]; // Array of catalog item IDs to exclude

function applyCustomizations() {

var currentURL = window.location.href;

// Check if the URL contains '/catalog/'
if (window.location.href.includes('/catalog/')) {
// Check if the URL contains a catalog item ID and if it's not in the excluded array
var catalogItemIdMatch = currentURL.match(/\/support\/catalog\/items\/(\d+)/);
if (catalogItemIdMatch && !excludedCatalogItemIds.includes(parseInt(catalogItemIdMatchd1], 10))) {
// Check if confirm request exists and, if so, click
if ($('#confirm-request').length > 0) {
$('#confirm-request').click();
}
}
}

}

// Apply customizations initially
applyCustomizations();

// Apply customizations every 1 seconds
setInterval(applyCustomizations, 1000);
});
</script>

Note: code is untested.