Set closed_by to system

samadam
Kilo Sage

I am trying to set closed_by to system in a scheduled job that would automatically close the record that match certain conditions. How can I do that? There is no System Admin in the User table but  job runs as system. Tried to set displayvalue to system and it did not work. Any way to set this?

6 REPLIES 6

JenniferRah
Mega Sage

You can run the job as the Admin or System Administrator user.

 

JenniferRah_0-1735331678113.png

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @samadam 

 

You can check OOTB rule or job in incident table which closed the incidents after 7 days as OOTB or you can use run as admin as suggested by @JenniferRah 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Gangadhar Ravi
Giga Sage
Giga Sage

@samadam I don't think system comes with default system admin account. But you can create one and use that in your run as.

 

Please mark my answer correct and helpful if this works for you.

Ankur Bawiskar
Tera Patron
Tera Patron

@samadam 

you can set the field value using gliderecord

gr.closed_by = 'system';

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader