Is it possible to change the user that comments on a ticket when doing a GlideRecord update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 01:34 AM
When ServiceNow receives a REST message to update a comment on a ticket, it adds the comment as the "Guest" account. Instead, I would like to add the comment to the ticket as the user who sent the REST message to ServiceNow. Is there a way to tell GlideRecord to update as another user. For example, is there a way to update a record via script just like you can while you are impersonating another user? It would be nice to have the activity log on the ticket show the correct user that left the comment.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 02:55 AM
Hi,
then update the sys_updated_by field for sys_journal_field record for that comment value
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
‎04-28-2022 03:19 AM
I tried,
If I tried to update the sys_created_by it always go back to my user.
And we do not have a sys_updated_by field on this table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2022 03:49 AM
Hi,
share your script where you are updating the sys_creaated_by of sys_journal_field table record
it should work
ensure you use this during update to forcefully update the field
obj.autoSysFields(false)
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
‎04-29-2022 10:50 AM
The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. If i want any further guideline we will contact you here see https://community.servicenow.com/community?id=community-results-question&sys_id=7ddb940f1bcb89d0587a11751a4bcbab
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2022 10:57 AM
The Information you shared above is great. I have been reading all you shared here. In this you explained everything very well. If i want any further guideline we will contact you here see https://community.servicenow.com/community?id=results=community_question&sys_id=7ddb940f1bcb89d0587a11751a4bcbab
Thanks