[Tips & Tricks] Quick links in request details page

[Tips & Tricks] Quick links in request details page

Hello users,

A customer came up with a requirement to have quick links in the request details page that changes dynamically based on the value present in a custom field.

Scenario:

Users in his environment use laptops of various manufacturers. He has configured an incident template exclusively for laptop issues and the template has a custom field that has a list of all those laptop manufacturers. So that when users submit a request using this template for laptop issues, they would choose the respective manufacturer. 

Once the request is submitted, he wanted the respective manufacturer's Knowledge Base site as a quick link in the request details page. These links would be very handy to access the articles when technicians come across new issues or to find information.

Solution:

This has been accomplished by Page Scripts. Find the execution steps below,

1. Create a picklist type additional field, mark it as common for both Incident and Service requests and add all manufacturers as values to the field.  Add the field to the desired template and copy the "UDF name" of the additional field created.

2. Modify the attached script to map the additional field UDF name, field values and URLs as per your requirement.

var x=$CS.getValue("WorkOrder_Fields_UDF_CHAR44"); 
var mapping={
};
if  (mapping[x]) {
$CS.addWidget('<a href="'+mapping[x]+'" target="_blank">Search in Manufacturer KB articles</a>','html','Knowledge Base','properties-section'); 


3.  Go to Admin > General settings > Page Scripts and configure the script as in the screenshot below.





4. Once configured, you will now have a widget added to the right pane with the respective manufacturer's KB site. Upon clicking the link, you'll have the KB site opened in a new tab.


How to find the UDF name of a field in the Request Form:

Open a template to which this functionality has to be added and make sure that the necessary request additional field is a part of it.  To get its UDF name, click on the Field and Form Rules tab and then click on New Rule.  In the Actions section select Execute Script and click on the Write Custom Script option.  Type the name of the field in the Refer Template Fields text box and click on the name of the field, once a match is found.  This will show the Field Label , Field name and Type in the right pane.The value provided against 'Field Label' is the UDF name which will be in the javascript.

Here are some screenshots of how it appears on the request details page.








This is just an example of how you can make your ServiceDesk Plus effective and efficient using page scripts. Using this feature, you can manipulate and customize pages as per your needs.

I hope you find this post useful.

You may want to check our previous article that explains about enhancing the protection for file attachments in ServiceDesk Plus.

                  New to ADSelfService Plus?