
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 07:33 AM
We have a custom table that was created by our implementation partner to store comments. I want to move those comments into the work_notes and comments field on the incident table.
I wrote a test script to test this, but it doesn't seem to show up.
var gr = new GlideRecord('sys_journal_field');
gr.element = 'work_notes';
gr.element_id = <sys_id>;
gr.name = 'incident';
gr.sys_created_by = <user_id>;
gr.value = 'some notes';
gr.insert();
Solved! Go to Solution.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2023 02:25 PM
After reviewing with ServiceNow, it is a system control to not allow for back dating or doing historical notes on behalf of someone. We decided to go ahead and run the script as system, and then insert the date the original comment was added with the username.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 07:36 AM
Hi,
you forgot to intialize
var gr = new GlideRecord('sys_journal_field');
gr.initialize();
gr.element = 'work_notes';
gr.element_id = <sys_id>;
gr.name = 'incident';
gr.sys_created_by = <user_id>;
gr.value = 'some notes';
gr.insert();
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
08-23-2022 07:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-23-2022 07:59 AM
Hi,
this link talks about using setWorkflow(false) during insertion but I tried that and it didn't work
also check this
Disabling auditing for Journal fields will break the Activity Formatter
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
08-23-2022 10:52 AM
I looked into both of the links you shared, and no luck. I have verified that if I add it directly to the incident record that works. I wouldn't be able to set the user and timestamp, if I use that approach. I opened up a case, and will update on their response.