Add Case field value as an Additional Comment
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2024 08:17 AM
Is it possible to have a value entered in a field on a Case, to be added to Activities as an Additional Comment instead of a Work Note? And, for it to only apply to a specific Case view?
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2024 10:31 AM
Would I add it to the beginning of the code you provided earlier?
(function executeRule(current, previous /*null when async*/) {
if (current.close_notes) {
// Create a new journal entry in Additional Comments
var journalEntry = new GlideRecord('sys_journal_field');
journalEntry.initialize();
journalEntry.element_id = current.sys_id;
journalEntry.name = 'comments';
journalEntry.value = current.close_notes;
journalEntry.insert();
}
})(current, previous);
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2024 10:47 AM
Hi @MStritt,
Use the previous code logic in the if condition block.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2024 10:53 AM
if (g_form.getViewName() == 'your_view_name') {
// Write your logic here
(function executeRule(current, previous /*null when async*/) {
if (current.close_notes) {
// Create a new journal entry in Additional Comments
var journalEntry = new GlideRecord('sys_journal_field');
journalEntry.initialize();
journalEntry.element_id = current.sys_id;
journalEntry.name = 'comments';
journalEntry.value = current.close_notes;
journalEntry.insert();
}
})(current, previous);