Change co relation number not updating
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 04:36 AM
Hello
I have used Rest API servicenow to servicenow Integration
I used the below code for change Co relation updates, but it's not updating if I try to update this change type changed in Emergency change. Please help me to fix this issue
=======================================================================
=============================================================
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 04:42 AM
I used this code for co-relation CR update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 05:05 AM
so what came in API response?
Did you print that?
try this and share logs
(function executeRule(current, previous /*null when async*/ ) {
var asmnt_grp = current.getDisplayValue('assignment_group');
var queue = current.getDisplayValue('u_queue');
var ebond;
var flag = '';
// Add logging for debugging
gs.log("Assignment Group: " + asmnt_grp);
gs.log("Queue: " + queue);
if (current.comments.changes() && current.work_notes.changes()) {
flag = 'comments_notes';
} else if (current.work_notes.changes()) {
flag = 'notes';
} else if (current.comments.changes()) {
flag = 'comments';
}
gs.log("Flag: " + flag);
if (current.correlation_display.toString() == '') {
ebond = new genericEbondingUtil().initiateEbonding(current.sys_class_name, current, 'insert', current.number.toString(), flag);
gs.log("Ebond Insert Response: " + ebond);
// updates of correlation number
var ebondResult = JSON.parse(ebond).result;
current.correlation_display = ebondResult.number;
current.correlation_id = ebondResult.sys_id;
current.update();
gs.log("Correlation Display: " + current.correlation_display);
gs.log("Correlation ID: " + current.correlation_id);
} else {
ebond = new genericEbondingUtil().initiateEbonding(current.sys_class_name, current, 'update', current.number.toString(), flag);
gs.log("Ebond Update Response: " + ebond);
}
})(current, previous);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 07:36 AM
Ebond Update Response:
I received multiple updates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 06:30 AM
Ebond Update Response:
I received multiple updates