setJournalEntry() ignores userName parameter?

Bj_rn G
Giga Contributor

Has anyone gotten the userName parameter to work on setJournalEntry? Specifically for a non-privileged account, i.e. not 'admin' or a user with the 'admin' role?

When I try to set a journal entry on a GlideRecord, e.g.

incident.comments.setJournalEntry('this is a comment','bjorn');

incident.update();

the comments get the journal entry, but the second parameter, username, is ignored. I've tried different variations on this, to no avail.

According to the documentation this the right way to add a journal entry, but the docs don't specify what a valid 'userName' value might look like. Is there additional documentation that specifies the right way to do this? Or does the username simply not work?

https://docs.servicenow.com/bundle/madrid-application-development/page/app-store/dev_portal/API_refe...

1 ACCEPTED SOLUTION

OOB there is ACL on sys_journal_field. please take a look at below

https://YourInstanceName.service-now.com/nav_to.do?uri=%2Fpersonalize_all.do%3Fsysparm_rules_table%3Dsys_journal_field%26sysparm_rules_label%3Dsys_journal_field


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

14 REPLIES 14

OOB there is ACL on sys_journal_field. please take a look at below

https://YourInstanceName.service-now.com/nav_to.do?uri=%2Fpersonalize_all.do%3Fsysparm_rules_table%3Dsys_journal_field%26sysparm_rules_label%3Dsys_journal_field


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

For Admins it will work. For non-admin you will have to create a new ACL of type write on sys_journal_field table. Better not to as this would then open the fields to be updated by non-admins as well for journal fields.

Thanks! I have found one caveat: if you add a comment during creation of a record, it appears that the setJournalEntry() ignores the second parameter no matter what.

Hi

Did you solve this issue? 

I'm facing this right now. I need to insert a comment as another user, but doesn’t work

Even i am not able to get the UserID in the work note for work_notes.setJournalEntry. It is ignoring the User ID