copy comments from problem_task to problem and vice versa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 01:01 AM
Hi guys ,
i have requirement related to copy of work notes from problem to problem_task and vice versa ,
for copying from problem to problem_task its working here is the code :
its after update BR on problem table :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 02:09 AM
the 2nd BR should be this
var problemRec = new GlideRecord('problem');
problemRec.addQuery('sys_id', current.problem);
problemRec.query();
if(problemRec.next()) {
problemRec.work_notes = current.work_notes.getJournalEntry(1);
problemRec.update();
}
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
12-02-2024 02:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 11:41 PM
hi @Ankur Bawiskar ,
its working now but getting like this :
its getting repeated comments can you please help !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 12:16 AM
check this link and it will tell solution on how to handle recursion
Sync'ing RITM and SCTASK work notes \ additional comments
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