Journal field value author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 04:47 AM - edited ‎01-10-2024 04:48 AM
Hi! setJournalEntry allows us to define author as a second parameter, but that doesn't seem to update sys_journal_field record, and getJournalEntry returns the actual user who did an update.
Does anybody know if it is possible to get to the value I see in the record where the comment/work note is (in server side script)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 04:53 AM
Can you please have a look on the below post. This behavior is being controlled by an OOB ACL which could be found on https://YourInstanceName.service-now.com/nav_to.do?uri=%2Fpersonalize_all.do%3Fsysparm_rules_table%3...
You can try using an admin account to fetch the user who did an update and see if it works.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 05:14 AM
Hi, I checked the ACLs, but I don't seem to get your advice. Did you try it? Which ACL do you mean exactly?
Just to get it clear, I don't need the sys_created_by value on sys_journal_field, but a value in the actual work note, if it is different from the sys_created_by value on sys_journal_field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 05:35 AM
Can you please check if the below logic works from Background scripts :
var je = new GlideRecord('sys_journal_field');
je.addQuery('element','work_notes');
je.addQuery('element_id', 'sys_id of your target record' );
je.orderBy('sys_created_on','ASC');
je.setLimit(1)
je.query();
if(je.next()){
gs.info('First comment: ' + je.value.toString()+' Updated By: '+je.sys_created_by);
}
I am able to get the right created by on a particular worknote with this.
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 06:26 AM
Try following:
1. update your record in bg script like: current.work_notes.setJournalEntry("the worknote value", "abel.tuter");
2. Do the magic and get "abel.tuter" from script and not your name or id