- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 09:42 AM
Hello,
I have need to add Work notes to sc_task record via script. (snap below). I am using script below, and I see the entry in the sys_journal_field table, but doesn't show it up on SCTASK record. Not sure what I am missing.
script:
var rec = new GlideRecord('sys_journal_field');
rec.initialize();
rec.setValue('name','sc_task');
rec.setValue('element_id',sysid); // (sys_id of SCTASK0021026)
rec.setValue('element','work_notes');
rec.setValue('value','Manager1 is Notified');
rec.insert();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 09:46 AM
You dont have to create a entry in sys_journal_field table, it will be automatically created when you update the comments or worknotes
var rec = new GlideRecord('sc_task');
if(rec.get('sysid'))// (sys_id of SCTASK0021026)
{
rec.work_notes="Manager1 is Notified";
rec.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 09:46 AM
You dont have to create a entry in sys_journal_field table, it will be automatically created when you update the comments or worknotes
var rec = new GlideRecord('sc_task');
if(rec.get('sysid'))// (sys_id of SCTASK0021026)
{
rec.work_notes="Manager1 is Notified";
rec.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2021 10:00 AM
Thanks Pranesh.
That really helped.