How to get incident number which was created through soap message another snow instance

Community Alums
Not applicable

Hello All,

 

I need set incident number which was created through soap message in other snow instance. please let me know, How we can set that value in below code

 

var s = new sn_ws.SOAPMessageV2('Soap Integration with other snow', 'insert');
    s.setStringParameter('insert.u_active', current.active);
    s.setStringParameter('insert.u_caller_id', current.caller_id);
    s.setStringParameter('insert.u_description', current.description);
    s.setStringParameter('insert.u_number', current.number);
    s.setStringParameter('insert.u_short_description', current.short_description);
    var response = s.execute();
 
    var body = response.getBody();
    var parseRes = JSON.parse(body);
    current.correlation_id = parseRes.result.number;
 
Thank you in advance.
 
Regards,
Swapna
 
 
4 REPLIES 4

Musab Rasheed
Tera Sage
Tera Sage

Hello,

If I understand correctly you want whatever Jira is responding you want to set in incident record of same Instance ? if yes try below once.

var body = JSON.parse(responseBody);
	current.correlation_id = body.id; //replace id with whatever you want
Please hit like and mark my response as correct if that helps
Regards,
Musab

Community Alums
Not applicable

Using soap, it was not giving the input. Not mapping correlation id. Please let me know how to get incident number ? which was created.

Arun_Manoj
Mega Sage

Hi @Community Alums ,

 

Please use Correlation id to map the Incident number from another instance.
Pleas keep in mind that there is another method provided by servicenow for instance to instance integration (Service bridge integration).
Please hit like and mark my response as correct if that helps
Regards,
Arun


Community Alums
Not applicable

For learning purpose I am practicing in PDI. could you please let me know the answer.