- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 02:30 PM
Hi guys! Forgive my ignorance and help me out with something.
I wrote a scheduled script that runs everyday closing incidents that are pending for a specific reason. The problem is, there's a data policy that only allows me to change the state if another field is filled (reason why the incident is closing, string field). That's fine, I can add another condition to the data policy so it doesn't run if the updated by field is system.
But then I noticed, when the script closes the incident (I made the data policy inactive for testing this), the updated field is filled with my user, so in the notes section of the incident, it shows that my user closed the incident, not the system. It's not like I'm manually executing the script, it's executing in a given time.
I could use gr.autoSysFields(false) on the script to avoid updating the "updated by" field, but that doesn't solve my problem, because I need to add a condition to the data policy not to run when updated by system.
So, my question is, what determines the updated by field? Is it whoever created the scheduled script? However last updated it? How can I force the script to be run by the system, not my user?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 02:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 02:50 PM
You can change the "Run as" field to system admin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 03:12 PM
That did it! Hah, if only I knew it was that simple. Thanks a lot!