Notifications

14 views

Description

How to set a sc_request field value based on whether the record was generated from the Service Portal or Platform 

Procedure

The solution is basically to examine the URI

  1. Create a new custom field on sc_request which would store the value of where the sc_request was originated from
  2. Create a new Business Rule
  3. Set Table = sc_request
  4. Check the 'Advanced' checkbox
  5. On 'When to run' tab, When = Before, Insert = checked, Update = checked
  6. Script:

(function executeRule(current, previous /*null when async*/) {

   var action = gs.action.getGlideURI().toString();
   if (action.indexOf('service_catalog.do') > -1) {
      current.<newField> = 'from_platform';
   }
   else
      current.<newField> = 'from_service_portal';

   })(current, previous);

 

NOTE: This is just a suggested solution which customers can customize, however it is not officially supported as out of box functionality.

Applicable Versions

All

Article Information

Last Updated:2019-03-29 13:00:51
Published:2019-03-29