How to send additional comments and work notes in request payload as JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 03:59 AM
Hi All,
I need the pass as the last additional comment and last updated work notes from Incident Record in the REST action as a payload. I tried using the below scirpt, but it returns the value with the timestamp and user name. If I pass this value in the request body, the JSON becomes invalid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2023 06:03 AM
Hi Priya,
Please try below code -
var incJson = {
"work_notes":fd_data.trigger.current.work_notes.getJournalEntry(1).match(/\n.*/gm).join("\n"),
"comments":fd_data.trigger.current.comments.getJournalEntry(1).match(/\n.*/gm).join("\n")
}
var res = JSON.stringify(incJson);
If my answer has helped with your question, please mark it as helpful and give it a thumbs up!
Regards
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 02:08 AM