Phillip Godwin
ServiceNow Employee
ServiceNow Employee

  The Service Bridge Remote Task Definition allows an admin to specify what fields are to be passed back and forth between a connected Provider and Consumer using a Remote Task.  Transforms can be specified that will alter a field value and/or label as it is passed from (outbound transform) and/or to (inbound transform) the Provider or Consumer instances.  An Advanced Transform allows the admin to include a script that will transform the data between the instances as required.

 

Service Bridge provides an object_data.remote_task_vars object that enables the reference and use in a transform script of any of the fields that have been included in the Remote Task Definition.  The purpose of this article is to describe how to reference Remote Task variables from a transform script.

 

I will use a simple example to demonstrate how this can be done.  My Remote Task Definition will trigger a Remote Task on the Consumer instance when an incident is assigned to the “Network Support” group, and the task will flow to the Provider instance and create a corresponding case.  In the Remote Task Definition, I have specified that the inbound Description field will synchronize between the incident and the case on Insert, and I have included the consumer incident Number as an inbound field but have specified that it will Never synch (i.e. it will not be written to a corresponding provider case field).

 

PhillipGodwin_0-1712177339802.png

 

I will use an Advanced Transform to add the customer’s incident number to the provider’s case description so the provider will have an easily visible reference to use in related discussions with the customer.

 

As mentioned above, the specified Remote Task variables can be referenced using the object_data.remote_task_vars object, but I need to know what the related field name for the incident number is so I can use it in my script.  To find a Remote Task variable field name, open the related Remote Task Definition and select the Remote tasks variables related list. 

 

PhillipGodwin_1-1712177339813.png

 

I can see that the field name for the inbound incident number is: number50270d9ec31c8210075c35aa05013126.

 

Now I can create an Advanced Transform with a script that uses the number field to transform the provider case description.

 

PhillipGodwin_2-1712177339819.png

 

See that the script adds the customer’s incident number to the case description by referring to the number field in the remote task variables object:

 

PhillipGodwin_3-1712177339822.png

 

And see the result…

 

PhillipGodwin_4-1712177339827.png

 

 

I hope this article helps you better understand how you can pass fields using Service Bridge Remote Tasks and then use them in your Transform scripts!

7 Comments