I need alert opened date should be populate on detection time filed in the incident

ashok17
Tera Contributor

I need alert opened date should be populate on detection time filed in the incident, Please suggest how to achieve this requirement and i have tried below After Business Rule on incident table but not works:

 

if (!current.u_detection_time && current.u_alert) {
var alertRec = new GlideRecord('u_alert');
if (alertRec.get(current.u_alert)) {
current.u_detection_time = alertRec.u_opened_at;
}
}

22 REPLIES 22

Hi @ashok17 ,
Its Opened in your case and make sure the backend name is u_opened_at else replace with correct value in script.

ashok17
Tera Contributor

Hi @Rakesh_M ,

Yes, Below is the opened field details in the alert record, below is the screenshots for all, please suggest what was the wrong for this.

ashok17_0-1777559922357.png

ashok17_1-1777559970230.pngashok17_2-1777560039958.png

 

Hi @ashok17 ,
What did you get in the logs?
Can you please share the logs.

Tanushree Maiti
Giga Patron

Hi @ashok17 

 

Create a subflow :

  • Trigger: When a new Incident is created.
  • Action: Lookup records where INC is active and Alert is not empty.
  • Action: Update the Incident Record to populate a u_detection_time field using the Opened field from the referenced Alert record.

 

Refer: KB0753955 Alert Management Explained 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Thanks for response,

I have tried flow also but i can't see alert option on condition, could you please check your end and confirm.