How to populate change task comments or notes in to change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 05:49 AM
Hai All ,
I have a Requirement that , I have a change request table and it consists of two change tasks , in the change task if we add any comments or Notes it should be populated in change request.
please help me on this,
Thankyou,
Sekhar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 05:54 AM
Hi Sekhar,
You need to write a business rule on change task table as below
Condition : worknotes changes
or
Comments changes
Script
var cr = new GlideRecord('change_request');
cr.addQuery('sys_id', current.change_request);
cr.query();
if (cr.next()) {
if (comments.changes()) {
cr.comments = current.comments;
}
if (work_notes.changes()) {
cr.work_notes = current.work_notes;
}
cr.update();
}
Mark as correct and helpful if it solved your query.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 05:56 AM
Hi,
2) Advanced
please mark helpful /correct based on impact
Regards,
Aniket S

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 06:00 AM
Hey Aniket,
I think you might have referenced to below link.
Its my humble request, avoid copying someone else's work, if you found something relevant, please share the link instead of just copying and pasting.
Hope you take this in good way.
https://community.servicenow.com/community?id=community_question&sys_id=fcd017a9dbdcdbc01dcaf3231f9619aa
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2022 05:58 AM
Create an After update BR on Change task table, with condition: Comment changes or Work notes changes
Code should be like:
var chg = new GlideRecord("change_request");
if(chg.get(current.getValue("change_request"))){
if(current.work_notes.changes()){
chg.work_notes = current.work_notes.getJournalEntry(1);
}
if(current.comments.changes()){
chg.comments = current.comments.getJournalEntry(1)
}
chg.update();
}
Aman Kumar