The CreatorCon Call for Content is officially open! Get started here.

Update by becomes "system" when I close incident tickets

Navaneeth1
Tera Guru

I have a custom application that inherits from the Incident Table. I had to create a custom business rule to update closed and closed by when I close a ticket because the states got altered for this custom application. After I close the ticket, the updated by becomes "system" and not the person who last updated it (Closed it). But when someone updates the closed ticket again and clicks update, then their name is populated in the Updated by. 

Could someone please tell me how to fix this and not show "system" on updated by when we close it?

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

If the transaction happens Async, (Async BR, Workdlow or flow on system session, scheduled job) then the Updated will come as System.

-Anurag

View solution in original post

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Navaneeth1 

 

I tried this native view and i can clsoed by - System admin ( as logged in user) and updated by also sys admin )logged by user. Its my OOTB PDI only.

*************************************************************************************************************
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]

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

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Can you share in detail how you are closing the record? You do mention business rule, please share in detail.

 

Unforseen behavior can be expected since you did extend Incident (which is not a good practice to do).

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hey @Mark Roethof ,

I have a custom script that does this in the business rule and the script content is given below:
Condition: current.active.changesTo(false)

Script:

(function executeRule(current, previous /*null when async*/) {
if (current.closed_by.nil())
current.closed_by = gs.getUserID();
if (current.closed_at.nil())
current.closed_at = new GlideDateTime ().getDisplayValue();

})(current, previous);




Anurag Tripathi
Mega Patron
Mega Patron

If the transaction happens Async, (Async BR, Workdlow or flow on system session, scheduled job) then the Updated will come as System.

-Anurag