- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 10:42 PM
I'm trying to update an incident's work_notes from POSTMAN with the below details, but it's not updating them. However I have referred the ServiceNOW documentation and trying the REST call the same way but still data is not getting updated.
Other fields like comments, description are getting updated or added, but only work_notes is not getting added.
We are using rest method
We have done mapping :
below is the script
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:12 PM
Hi,
If the source field is also of type work note use script
var workNotes = source.u_work_notes.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
workNotes = workNotes.replace(dateRE, '');
target.work_notes = workNotes;
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:06 PM
Hello @Laxmi18,
Please refer to the below link:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0957567
If it is helpful, please mark it as helpful and accept the solution.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:12 PM
Hi,
If the source field is also of type work note use script
var workNotes = source.u_work_notes.getJournalEntry(1);
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
workNotes = workNotes.replace(dateRE, '');
target.work_notes = workNotes;
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 11:17 PM