Recurring Service Portal/Announcements

jschnoll
Tera Contributor
  • Our team has been utilizing Service Portal/Announcements to communicate system-wide announcements to users. In the screenshot below, you can see the example of said banner at the top of the browser window. 
  • jschnoll_0-1747679791106.pngGetAttachmentThumbnail.png
  • For the foreseeable future, the Announcement in questions in needs to be visible to employees every other week
  • We have not been able to figure out a way for Announcements to automatically publish/unpublish. In lieu of that, we have been manually adjusting the dates of the Announcement. For various reasons it is not desirable to depend on staff to manually publish/unpublish this content for the foreseeable future.
     
Questions:
  • Can an Announcement become visible/hidden at recurring intervals? Or is feature intended to be utilized for singular events?
  • Based on the documentation, Campaigns seem useful for delivering targeted, scheduled Content. Despite trying, I have not been able to add Announcements to Campaigns. Is there something I'm overlooking? 
  • Does the ServiceNow Community have any other recommendations?
1 ACCEPTED SOLUTION

Dinesh Reddy By
Kilo Sage

 @jschnoll You can create a bi-weekly schedule job to update the announcement date fields.

var announcementId = '2689b23e87416a10efed74c9cebb35a4';
var gr = new GlideRecord('announcement');
if (gr.get(announcementId)) {
    var now = new GlideDateTime();
    gr.from = new GlideDateTime(now);//scheduled job start time (bi weekly job)
    var endDate = new GlideDateTime(now);
    endDate.addDays(7);
    gr.to = endDate;

    gr.update();
}

Thanks,

Dinesh
Please accept the solution and thumbs up if it helps you 

View solution in original post

1 REPLY 1

Dinesh Reddy By
Kilo Sage

 @jschnoll You can create a bi-weekly schedule job to update the announcement date fields.

var announcementId = '2689b23e87416a10efed74c9cebb35a4';
var gr = new GlideRecord('announcement');
if (gr.get(announcementId)) {
    var now = new GlideDateTime();
    gr.from = new GlideDateTime(now);//scheduled job start time (bi weekly job)
    var endDate = new GlideDateTime(now);
    endDate.addDays(7);
    gr.to = endDate;

    gr.update();
}

Thanks,

Dinesh
Please accept the solution and thumbs up if it helps you