- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2022 07:50 AM
I want to set the additional comments through schedule job.I am able to display the data on the journal table not on requested form.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:24 AM
That's not a proper way to write additional comments.
You will need to write it by setting the value on the task-record instead.
Something like this:
var incGR = new GlideRecord('incident');
incGR.setLimit(1);
incGR.query();
while (incGR.next()) {
incGR.comments = 'New additional comment here';
incGR.update();
gs.info('Updated incident: ' + incGR.getValue('number'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2022 08:44 AM
Can you share the code snippet?
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2022 09:14 PM
var grJrnl = new GlideRecord('sys_journal_field');
grJrnl.initialize();
grJrnl.setValue('name', 'sc_req_item');
grJrnl.setValue('value', 'This requested item is no longer availabe');
grJrnl.setValue('element', 'comments');
grJrnl.setValue('element_id', gr.sys_id);
grJrnl.update();
I have written this code ..I am able to display the data on journal table but not on requested form

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 02:24 AM
That's not a proper way to write additional comments.
You will need to write it by setting the value on the task-record instead.
Something like this:
var incGR = new GlideRecord('incident');
incGR.setLimit(1);
incGR.query();
while (incGR.next()) {
incGR.comments = 'New additional comment here';
incGR.update();
gs.info('Updated incident: ' + incGR.getValue('number'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 08:05 PM
Thankyou, it is working perfectly