Timestamp from sys_audit table

JuileeD
Tera Contributor

Hi Ninja's,

 

We have a custom date/time field on INC table named as Last Customer Update - readonly, for reporting purpose.
 
Requirement:
If the Caller has an email address, this custom field should display last 'Additional Comments' timestamp.
If the email is empty or isn't a valid email address then custom field should display last 'Work Note' timestamp.
 
I have been trying to achieve it via BR by querying on 'sys_audit' table but not getting the required output.
 
Thanks in advance!
1 ACCEPTED SOLUTION

Najmuddin Mohd
Mega Sage

Hi @JuileeD ,
The another solution I have used to get your requirement is I have created two business rules.

One business rule on the incident table with conditions caller.email is empty and worknotes changes.

Another business rule with condition caller.email is not empty and
current.u_customer_last_update = new GlideDateTime();

In the advanced script,
current.u_customer_last_update = new GlideDateTime();

If the caller does not have an email, then first Business rule will trigger.
If the caller has an email, then second business rule will trigger.
 
NajmuddinMohd_0-1724939987579.png

 

NajmuddinMohd_1-1724940045009.png

 

NajmuddinMohd_2-1724940066276.png


If this information finds you helpful, Kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.




View solution in original post

3 REPLIES 3

Najmuddin Mohd
Mega Sage

Hi @JuileeD ,
The another solution I have used to get your requirement is I have created two business rules.

One business rule on the incident table with conditions caller.email is empty and worknotes changes.

Another business rule with condition caller.email is not empty and
current.u_customer_last_update = new GlideDateTime();

In the advanced script,
current.u_customer_last_update = new GlideDateTime();

If the caller does not have an email, then first Business rule will trigger.
If the caller has an email, then second business rule will trigger.
 
NajmuddinMohd_0-1724939987579.png

 

NajmuddinMohd_1-1724940045009.png

 

NajmuddinMohd_2-1724940066276.png


If this information finds you helpful, Kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.




Thanks much! This helped!!!

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

In general, using Sys Audit for something like this is a no no no no no. Sys Audit is usually one of the biggest tables in any instance (or even the biggest), does not perform that well, not uncommon to contain billions of records when unmanaged.

 

Reading your description, the custom date/time field is not fixed? Its more like a dynamic date right, so it needs to be updated everytime someone adds an additional comment or work note (depending on the caller email address as you mentioned)? 

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn