Update updated by with the help of background script / Business Rule on SCTASK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 07:29 AM
Hi All,
Whenever anyone update the sctask updated by name should be specific user in worknotes.
Like if User A update the sctask and added "abcd" in worknotes then abel tutor name should be come.
I am using below background script but somehow it is not working:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 10:09 AM - edited 10-15-2024 10:33 AM
Hi @Mukul Sharma ,
I don't think we can update some system fields like updated by , created by . refer below KB article and according to it
Some system fields like below does not get updated from Some old value to a new value through any APIs or Scripts manually!!
1. Updated by
2. Created by
KB Article - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0859763
However , as a workaround you can create Scheduled Script Execution .In it we have option to Run As (By default it is not present on form you need to add it ). Please check below screenshots
Result
If my reply helped with your issue please mark helpful 👍and correct ✔️if your issue is resolved.
By doing so you help other community members find resolved questions which may relate to an issue they're having
Thanks,
Astik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 10:14 AM
You can try adding ri.autoSysFields(false) before the update. I hope this doesn't work - kind of undermines the validity of Updated by being a system field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 10:28 AM - edited 10-15-2024 10:28 AM
Hi @Brad Bowman ,
Even after using autoSysFields(false) . It is taking updated by as current logged in user
Thanks,
Astik