Create Automatic Announcement when Major Incident is promoted on service Portal

williams2
Tera Expert

Hello, can someone help me with my next question?

Is it possible to generate an automatic announcement that is displayed in the service portal when an incident is critical?
which when displayed, shows the date and incident number

If it is possible, how can this be done?
I hope someone can help me with my doubt
Thank you
regards

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

You can create Announcement dynamically when Incident is converted to a Major incident as you want. BR which I have shared above will do the same thing and will create a Announcement record and also at the same time will create a Relationship between Announcement and the table which links the Announcement to Portal on where it should be displayed.

Posting the screenshot of the BR as well:

find_real_file.png

 

If you are unsure on Portal sys id then Navigate to Portal module and open your portal record and then Right click on the header and copy sys id . For example see screenshot below:

find_real_file.png

find_real_file.png

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

7 REPLIES 7

Shakeel Shaik
Giga Sage
Giga Sage

Hi Williams,

I think its not possible, because we can create Announcements dynamically.

Thanks,
Shakeel Shaik 🙂

In conclusion, Announcements can only be created manually, correct?

shloke04
Kilo Patron

Hi,

What you can do here is, create a Business Rule on Incident Table and use the script below:

BR Details:

Table Name: Incident

When: After Insert and Update

Condition: Major Incident State is Changes To proposed or Accepted

Script:

(function executeRule(current, previous /*null when async*/) {

	// Add your code here
	createAnnouncement();
	
	function createAnnouncement(){
		var gr = new GlideRecord('announcement');
		gr.initialize();
		gr.name = 'Value you want to set';
		gr.title = 'Value you want to set';
		gr.summary = 'Value you want to set';
		var success = gr.insert();
		if(success){
			createPortalEntry(gr.sys_id);
		}
	}
	
	function createPortalEntry(announceID){
		var gr1 = new GlideRecord('m2m_announcement_portal');
		gr1.initialize();
		gr1.announcement = announceID;
		gr1.sp_portal = 'Sys id of Portal where you want to show this';
		gr1.insert();
	}

})(current, previous);

Just replace the value in placeholder above and this should work for you.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hello shloke04,

Thanks for sharing your knowledge, when promoting the incident I expected that the name of the Announcement and Title would be filled in. In this way we can trigger the Announcement to show up in the correct way.

After promoting the INC it asks for a *Worknote.

I'm currently struggling to find which values should be filled in to do so.

WesleyChing_0-1697105045521.png


Any advice?