How to remove announcements from announcement widget and banner when incident is resolved.

Rose17
Tera Contributor

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.

find_real_file.png

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.

find_real_file.png

Could someone help me to achieve this asap?

@Ankur Bawiskar Your help is highly appreciable.

Thanks in advance.

 

1 ACCEPTED SOLUTION

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

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

So did you debug the 2nd BR and check if it finds the record?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Actually 2nd BR works and announcement record sets to active=false. But the incident announcement is still shown in portal. When i set the state to resolved, a new record is created in announcement which is made false. This should not be the case.

The first announcement record created when incident was promoted to Major incident, that should be made inactive.

I think the issue is- whenever i update something in incident, a record is created in announcement. So due to duplicate announcement records referring to same incident is causing an issue.

Am i correct?

Check below screenshot-

find_real_file.png

Hi,

is the 2nd BR condition getting satisfied?

Try making that BR as after update and don't make it Async then check

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I tried after, update BR. But what is happening is- when i change the state to resolved, it creates a new record in announcement table which is true, and the previous record which was created when incident was promoted to major incident, that record is made false. 

As the new record is true, thats the reason incident is still shown in portal.

It should not create a new announcement record, when i change the state to resolved.

Check below ss-

find_real_file.png