I need alert opened date should be populate on detection time filed in the incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rakesh_M ,
I have updated as you mentioned above condition in the Business Rule but not works, please refer below screenshots and suggest:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
are you sure when BR runs the u_alert field on INC is populated?
Also since your BR is after simply setting the value won't help, it needs to be saved
You should have before Insert/Update BR with this script
if (current.u_detection_time == '' && current.u_alert) {
current.u_detection_time = current.u_alert.u_opened_at;
}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes, the alert table was 'u_alert'