Display Service Catalog Request Link on Associated Service Desk Request

Document created by Grant Bruneau Champion on Jan 21, 2017Last modified by Grant Bruneau Champion on Jan 22, 2017
Version 5Show Document
  • View in full screen mode

Hi Community,

 

The following customization will conditionally display a Service Catalog button on a Service Desk Request or Incident, linking it to the Service Catalog Request.  The out of the box Create Incident Service Catalog action will write the Service Catalog Request Item ID and Request ID to the external_system_ticket field in Service Desk.  To display the Service Catalog link from Service Desk, we need to check if external_system_ticket starts with CASC and if so, grab the last set of numbers, which relate to the Service Catalog Request ID.  Then we can add the Request ID to the end of the URL that is generated for the Service Catalog button.

 

This customization involves adding a few lines to detail_cr.htmpl and detail_in.htmpl.  It requires that NX_CASC_INTEGRATED  be set to Yes, and have a valid URL entered for NX_CASC_ENDPOINT.  The NX_CASC_ENDPOINT url is split into parts using the / as a delimiter.  This is then fed into the variable cascRequestLink with the remaining pieces of the URL tacked onto the end.

 

 

  1. Add the following code to detail_cr.htmpl and detail_in.htmpl
    • detail_cr.htmpl: This code should be added after <PDM_MACRO name=dtlForm factory=cr>
    • detail_in.htmpl: This code should be added after <PDM_MACRO name=dtlForm factory=in>
<PDM_IF "$args.external_system_ticket" != "" && "$env.NX_CASC_INTEGRATED" == "Yes">
var cascRequestStr = "$args.external_system_ticket";
var splitCascRequestStr = cascRequestStr.split("-");
var cascCheck = splitCascRequestStr[0];
var cascRequestID = splitCascRequestStr[2];
var cascSvcLink = "$env.NX_CASC_ENDPOINT";
var splitCascSvcLink = cascSvcLink.split("/");
var cascRequestLink = splitCascSvcLink[0] + "//" + splitCascSvcLink[2] + "/usm/wpf?Node=icguinode.requestprofile&Args=" + cascRequestID;
if(cascCheck == "CASC" && typeof cascRequestID != "undefined" && cascRequestID != ""){
<PDM_MACRO name=button Caption="Service Catalog[S]" Func="window.open(cascRequestLink, '_blank')" hotkey_name="Service Catalog[S]" ID=SC_LINK>
}
</PDM_IF>

2. Clear the webcache

  • pdm_webcache -H

 

4 people found this helpful

Attachments

    Outcomes