Send last comment to email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi,
I have a flow that sends an email when someone writes a comment in a work order task. I am sending template message with the number of the WOT. When I reply to that email, the text gets sent to the activity of the WOT.
Here is where the problem starts. I tried adding the actual comment to the body of the email via data pill , however the flow returns and error "invalid body html".
Then I tried a different approach, by adding a custom action with a script step that pulls the comment, but it didn't work either. Is there a way to pull the last message from the activity to the mail body?
The idea of the whole thing, you write a comment in the WOT - a mail gets send to a defined recipient, e.g. a contractor. He sees that message, and replies back via the email. Everything works, except for the comment not being sent. I would appreciate if you point me to the right direction.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
share some screenshots
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi @MartinV
That’s why you need to read from sys_journal_field to get the latest comment or work note and then add that text to the email body.
Try to write the script using this table .
Please like the comment if helpful and if u got your answer please mark it as the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi @MartinV
did you try to use the getJournalEntry method to get the latest comments of that Work order task
var comment = current.comments.getJournalEntry(1);
return comment;
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You
