How to populate alert open date on 'Detection Time' field in the incident form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
How to populate alert open date on 'Detection Time' field in the incident form when ever alert attached in the incident.
I have tried below before Business Rules script but doesn't works: Please suggest
// If an alert is attached to the incident
if (current.alert) {
var alertGR = new GlideRecord('em_alert');
if (alertGR.get(current.alert)) {
// Set Detection Time to the alert's opened_at value
current.u_detection_time = alertGR.opened_at;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
BR is on which table?
what debugging did you do?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
BR is Incident table:
Requirement was If incident have alert attached then the alert open date should be auto populate on 'Detection Time' field in the incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday - last edited Tuesday
Why don't you use flow for the requirement?
Flow Trigger : Incident created or updated
Lookup records where Incident is active and Alert is not empty
Use for each loop to go through the records
If count > 0
Use Update Record action to auto populate Detection Time field
You could check the similar logic here : https://www.servicenow.com/community/itsm-forum/flow-designer-search-for-incidents-that-has-attachme...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tuesday
Thanks for response,
But how we will map condition flow on alert attached incident then only detection time updated?
Thanks,
Ashok
