Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to send the ritm variable value to 3rd party

Nisha B
Tera Expert

Hello All,
I have build soap message to send the RITM information to 3rd party.
This soap message is calling through business rule but when I am trying to send the variable value , it is giving me undefined .
I just want to send only the 3 variables from that not all variable and code is like-

req.setStringParameter('request.Operation','current.variables.request_type');
req.setStringParameter('request.SecurityID','current.variables.owned_by_create.user_name');
req.setStringParameter('request.Description','current.variables.description_create');
 
but above is giving undefined .Please suggest .

I am using below code in business rule
 var grVar = new GlideRecord('sc_item_option_mtom');
   grVar.addQuery("request_item",current.sys_id);
   grVar.query();
  
   while (grVar.next()){
         var fieldName = grVar.sc_item_option.item_option_new.name.toString();
         var val = grVar.sc_item_option.value.toString();
 gs.log("Update Option value Nisha   "+fieldName +" "+ val);
}
 
but this is giving all variables I just need 3 variable and that need to be send on soap message.
@Ankur Bawiskar  If you can help please
 
Thanks
1 REPLY 1

Nisha B
Tera Expert

I am using below script -

 var grVar = new GlideRecord('sc_item_option_mtom');
   grVar.addQuery("request_item",current.sys_id);
grVar.query();
   while (grVar.next()){
         var requestType = grVar.sc_item_option.item_option_new.name.toString();
         var val = grVar.sc_item_option.value.toString();
        gs.log("Update Option value"+requestType +" "+ val);
   }

I am getting all the variables , I just need 3 variable among that for eg A1, A2, A3 and only this 3 variable I need to send.