- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 08:06 AM
I want to get the rejected comment only as the subject line but not all comments
Solved! Go to Solution.
- Labels:
-
Project Portfolio Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 07:14 PM
you need to remove that timestamp like this
var value = current.comments.getJournalEntry(1);
var str = value.split(' - ')[1];
var name = str.split(') ')[0] + ')';
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
gs.info(name);
var onlyComments = value.replace(dateRE, '');
template.print('Rejection comments' + onlyComments);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 08:10 AM
Hi,
you can pick the latest comments from approval record
you need to use email script for this
template.print(current.comments.getJournalEntry(1));
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 08:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 07:14 PM
you need to remove that timestamp like this
var value = current.comments.getJournalEntry(1);
var str = value.split(' - ')[1];
var name = str.split(') ')[0] + ')';
var dateRE = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}.*\n/;
gs.info(name);
var onlyComments = value.replace(dateRE, '');
template.print('Rejection comments' + onlyComments);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2022 07:18 PM