Business rule for enable notification on Emergency change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 11:05 PM
Need help define business rule to enable a email notification to Technology Approver , Business approver, Major Incident Manager(MIM) and Change owner on emergency changes when Emergency change moves from implement to Review state.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 02:12 AM
Hi @sureshpcse ,
create
Business Rule:
Name: Notify on Emergency Change State Transition
table :change_request
Advanced:true
when: after update :true
filter condition :
Script:
var userList = [];
/*push all differnet user sysid to userList array like
if that present in change form do like current.getValue('change_owner');
and psuh like userList.push(current.getValue('change_owner') + "");
if everytime Technology Approver , Business approver, Major Incident Manager(MIM) and Change owner are same then put system properites fetch form there
*/
var ids= gs.getProperty("sys_id_of_All_owner");
ids=ids.split(',');
for(var i=0 ;i<ids.length;i++){
userList.push(ids[i]+'');
}
gs.eventQueue("EVENT-NAME", current, userList.toString());
Thanks,
BK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2024 09:06 PM
Hi,
Thanks for the solution. Can you please help on to get Major Incident Manager from different table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 02:58 AM
Can i push Technology Approver, Business approver like Change Owner. And those things added to the eventQueue.
userList.push(current.getValue('u_change_owner') + "");
userList.push(current.getValue('u_asset_tech_owner_approval') + "");
userList.push(current.getValue('u_impacted_service_manager') + "");
gs.eventQueue('eventname', current, userList.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2024 09:44 PM
Hi @sureshpcse ,
For bring Major Incident Manager information in Change you should have at least link between that change and Major incident.
you can try something like this
var userList = [];
/*push all differnet user sysid to userList array like
if that present in change form do like current.getValue('change_owner');
and psuh like userList.push(current.getValue('change_owner') + "");
if everytime Technology Approver , Business approver, Major Incident Manager(MIM) and Change owner are same then put system properites fetch form there
*/
var ids= gs.getProperty("sys_id_of_All_owner");
ids=ids.split(',');
for(var i=0 ;i<ids.length;i++){
userList.push(ids[i]+'');
}
//trying to fectch major inicdent manager
/* here i took the example assign to of major incident is itself is MIM*/
var grlistsys = [];
var gr = new GlideRecord("incident");
gr.addQuery("rfc", "c038f10d93530210260bb2ddfaba1021");
gr.addQuery("major_incident_state", "accepted");
gr.query();
while (gr.next()) {
grlistsys.push(gr.getValue('assigned_to'));
}
// Concatenate userList and grlistsys correctly
var combinedList = userList.concat(grlistsys);
gs.eventQueue("EVENT-NAME", current, combinedList .toString());
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful."