daily pastebin goal
77%
SHARE
TWEET

Untitled

a guest Oct 17th, 2017 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var grSOT = new GlideRecord("incident");
  2.     if (grSOT.get(sIncidentSysID)){
  3.         sIncidentNumber = grSOT.getValue('sys_id');
  4.         invokeRest();
  5.     }
  6.    
  7.     function invokeRest (){
  8.     var request = new sn_ws.RESTMessageV2();
  9.     request.setEndpoint('https://dev19635.service-now.com/api/127390/google');
  10.     request.setHttpMethod('GET');
  11.    
  12.     //Eg. UserName="admin", Password="admin" for this code sample.
  13.     var user = 'admin';
  14.     var password = 'Hordemarsh121110179@';
  15.    
  16.     request.setBasicAuth(user,password);
  17.     request.setRequestHeader("Accept","application/json");
  18.     request.setQueryParameter("u_short_description",current.u_short_description);
  19.    
  20.    
  21.     var response = request.executeAsync();
  22.     //r.executeAsync();
  23.     var result = JSON.parse(response.getBody());
  24.     current.u_translate_short_description = result.result;
  25.  
  26.    
  27.     //var response = r.execute(true);
  28.     gs.log(response.getBody());
  29.     }
  30.    
  31.    
  32.  
  33. })(current, previous);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top