Help Updating Work Notes using a REST Message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 06:29 AM
I'm having issues with updating the work notes using a REST message.
Script Include:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 06:50 AM
when you get the journal field value you get date/time and user details as well
use this to only include value from worknotes and not the date/time and user info
var workNotes = incGR.work_notes.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
workNotes = workNotes.replace(dateRE, '');
request.setStringParameterNoEscape("notes", workNotes);
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
11-13-2023 08:17 AM
The work notes are showing as undefined. Any idea why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:36 AM
Hi @Randy33 ,
It's because u should write it this way
var workNotes = incGR.work_notes.getJournalEntry(1);
U used workNotes hence the undefined.
The backend value for work notes is work_notes.
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 09:08 AM
First, thank you however it is still not working.
Here is what I have in the script include. I'm also using a staging table (transform map) on the other side.
Thoughts?