- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 01:21 AM
Hi All,
When an incident is promoted to major incident, the major incidents should be shown in announcement widget in portal.
I have created a BR to create announcement which is perfectly working fine.
Below is the BR to create incident announcement-
Type- Async, insert, update. Condition- when major incident state is accepted.
Now I want to remove the announcement from widget and banner in portal when incident is resolved/closed.
This is possible when the announcement record is made inactive and field- 'to' (type- glide date time) has some value in it.
To remove the incident from announcement widget- Announcement should become inactive
To remove the incident from banner as well- Field- 'to' in announcement table should have a current/before date/time value in it.
I have written another BR to remove announcement as below, but it doesn't seem to work.
Async, update, condition- state changes to resolved or state changes to closed.
Could someone help me to achieve this asap?
Thanks in advance.
Solved! Go to Solution.
- Labels:
-
Major Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 04:29 AM
Hi,
As I told the update from 2nd BR might be causing the 1st BR to run and insert
try to adjust 1st BR condition to check if record already exists or not
if not then only create new record into announcement table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 02:36 AM
Hi,
Did you try checking the query returned the correct record?
if the query is satisfied then it should update and not create.
Possibly then update is triggering the 1st BR and creating new record.
try to adjust that BR condition
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 02:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 03:35 AM
Hi,
Did you add logs in the 2nd BR?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 03:44 AM
Yes.
The sys_ids in announcement record and logs is the same.
this is the script-
(function executeRule(current, previous /*null when async*/ ) {
var grAnRecord = new GlideRecord('announcement');
gs.addInfoMessage('hello');
if(grAnRecord.get('name',current.sys_id))
{
gs.log('test ruhi' +grAnRecord.name);
grAnRecord.active = false;
grAnRecord.update();
}
})(current, previous);
Logs-
Announcement records-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-05-2022 04:29 AM
Hi,
As I told the update from 2nd BR might be causing the 1st BR to run and insert
try to adjust 1st BR condition to check if record already exists or not
if not then only create new record into announcement table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader