I need a way to create an announcement within the system status on the portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 12:19 PM
Hello Developers,
I want to be able to create announcements on the system status on the service portal so that when go to knowledge and create a KB = IT and category = Email
Then the article will display within the announcement field on the system status page of the service portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 01:32 PM
Hi Cynthia,
which 'announcement field' are you referring to? There is no announcement widget on system status page in OOB.
My suggestion would be to create a business rule after creation (or publishing) a KB article with the parameters you specified to create an announcement record (and define it only for widget, not banner)
Additionally you would need to place Announcement widget in system status page to show that announcement.
Banner is not feasible here as it can only be limited on portal level so if you want to see it only on system status page it would still bother other portal users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2022 02:42 PM
Hello
My apologies for the confusion, that is exactly what I am looking for
How do I modify the KB article with the parameters you specified to create an announcement record (and define it only for the widget).
I found an existing widget that does exactly what I am looking for and I cloned and modified the parameters or at least I think I did but it does not seem to work. I have attached a copy of my script below. Can you have a look and let me know where I went wrong
And how do I place the Announcement widget in the system status page to show the announcements
var t = data;
var z = new GlideRecord('kb_knowledge');
z.addQuery('workflow_state', 'published');
z.addQuery('kb_knowledge_base.', 'CONTAINS', 'IT');
z.addQuery('valid_to', '>=', (new GlideDate()).getLocalDate().getValue());
z.addEncodedQuery('publishedONLast 7 days@javascript:gs.beginningOfLast7Days()@javascript:gs.endOfLast7Days()');
z.orderByDesc('published');
z.setLimit(options.max_number || 5);
z.query();
t.rowCount = z.getRowCount();
t.articles = [];
t.title = options.title || gs.getMessage("Announcement");
while (z.next()) {
if (!z.canRead())
continue;
var a = {};
a.short_description = z.getValue('short_description');
a.sys_view_count = z.getValue('sys_view_count');
a.sys_id = z.getValue('sys_id');
a.published = z.getValue('published');
a.published_display = gs.getMessage("Published {0}", z.getDisplayValue('published'));
t.articles.push(a);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 01:31 AM
Hi Cynthia,
before you begin to setting this up - be aware that announcements cannot work with multiple lines. So if you want to publish the KB article content you may end up like this
Anyway, your script seems too complicated, my steps would be following:
1. Create after update business rule with conditions you need (knowledgebase, category, + workflow changes to Published - you only want to create announcement when KB article is being published, right?) Be aware there are two 'Category' fields in the article you need to choose the kb_category
2. Create a script in this business rule, to create a new announcement
(function executeRule(current, previous /*null when async*/) {
var announcementGR = new GlideRecord('announcement');
announcementGR.initialize();
announcementGR.name = 'Autocreated from ' + current.number;
announcementGR.title = current.short_description;
var fromDateTime = new GlideDateTime(); // adjust date according to your needs
announcementGR.from = fromDateTime;
announcementGR.summary = current.text;
announcementGR.type = '67eaf134e7a3320075c2a117c2f6a9d2'; // sys ID of 'Widget' type
announcementGR.insert();
})(current, previous);
3. Test that if you create a new article matching conditions of BR it will create a new announcement in the [announcement] table
4. Go to portal System status page, Ctrl + Right click on a widget and select 'Edit in Page editor'
5. Find Announcement widget and move it to page where you need it
6. Test that System status page again, you should be able to see it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2025 02:42 AM
It is creating a new announcement but when i am trying to update the existing kb article instead of updating the annoucement it is again creating a new announcement.