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.

Outbound rest Integration

maheshchokkara
Tera Contributor

Hi all,

When I am implementing integration between my two Personal developer instance connections was successful 
Req : whenever I create an record on source instance I want to create a record with the same details on the target instance

 

Issue : when I create an incident on source instance with parameters caller, short description and category, asssignment_group. The incident is created on the target instance as well, but the caller is showing the integration user this user details I used in authentication and assignment group is empty these both are reference fields issue is with reference 

Hi all,

When I am implementing integration between my two Personal developer instance connections was successful 
Req : whenever I create an record on source instance I want to create a record with the same details on the target instance

 

Issue : when I create an incident on source instance with parameters caller,short description and category and assignment_group. The incident is created on the target instance as well but the caller is showing the integration user this user details I used in authentication and assignment group also not populating the problem is this reference fields
can any one help me

maheshchokkara_0-1719044786713.png

This is the BR i'm calling rest api request body i defined in rest message

4 REPLIES 4

SwathiPedireddy
Kilo Sage

Hi @maheshchokkara 

Caller and Assignment Group should be available in target Instance with same sys_id as source instance then only your script will populate caller and assignment group values in target instance.

Try replacing with following two lines

request.setStringParameterNoEscape('caller_id', current.getDisplayValue('caller_id'));
request.setStringParameterNoEscape('assignment_group', current.getDisplayValue('assignment_group'));
 
Thanks,
Swathi

Thanks for the response issue is already resolved I regenerated the variables later its working fine.

SN_Learn
Kilo Patron
Kilo Patron

Hi @maheshchokkara ,

 

In the callerId you are passing it as string, try passing the sysID only as it is a reference field. Similarly for the assignmentGroupId

 

Remove .toString() from line 16 & 11, then try again.

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Thanks for the response issue resolved there is no problem with .toString() problem with variables I sorted