Please use docs.servicenow.com for the latest documentation.

This site is for reference purposes only and may not be accurate for the latest ServiceNow version

RSS Feed Generator

From Wiki Archive
Jump to: navigation, search
Note
Note: This article applies to Fuji and earlier releases. For more current information, see RSS Feed Generator at http://docs.servicenow.com

The ServiceNow Wiki is no longer being updated. Visit http://docs.servicenow.com for the latest product documentation.

Overview

ServiceNow supports the dynamic generation of RSS feeds. Much like our Web Services implementation, the retrieval of an RSS feed representation of information is simply done by specifying an RSS parameter at the end of thr URL to a table list. For example, the following will return a list of all incidents in RSS 2.0 format.:

Adding a Query

To associate a query to the list so that a filtered list is returned, use the sysparm_query parameter. For example, the following will return a list of all incidents where the priority field is 1 (Critical):

 https://<instance name>.service-now.com/incident.do?sysparm_query=priority=1&RSS

If you have a multi part query then you would separate the parts with the ^ character. For example to get all priority 1 incidents with a category of software you would:

 https://<instance name>.service-now.com/incident.do?sysparm_query=priority=1^category=software&RSS

If you want to query on a field that is a reference to another file then you need to use javascript to resolve the reference to the other file. For example, the assigned_to field in incident is a reference to a user record. If you wanted to find all the incidents assigned to "ITIL User" then you would do the following:

 https://<instance name>.service-now.com/incident.do?sysparm_query=assigned_to=javascript:GetIDValue('sys_user','ITIL%20User')&RSS
Note
Note: You can in most cases simply append "&RSS" to a URL that you generate in the U.I. or that of your favorite module. The easiest way to get the URL is to simply click on the last breadcrumb from the list view. After appending "&RSS" then you can use this URL in your RSS feed reader


Image:getBreadURL.png

Limiting results with a view

The description element in the returned RSS xml is constructed using the view as specified in the URL, when no view is specified, the default no-name view is used. To change this format, specify the sysparm_view parameter on the URL. For example, the following will return the previous list, however the description element will now be restricted to the fields only available to the ess view:

 https://<instance name>.service-now.com/incident.do?sysparm_query=priority=1&sysparm_view=ess&RSS


Additionally, the RSS item title can be modified using the sysparm_title_view URL parameter. When specified, the item title will be constructed using the fields specified in the view. For example:

 https://<instance name>.service-now.com/incident.do?sysparm_query=priority=1&sysparm_view=ess&sysparm_title_view=rss_title&RSS

Formatting results

The description element in the returned RSS xml can be formatted by setting the URL parameter sysparm_format=true and specifying the format string in the property glide.rss.description_format. By default, when the URL parameter is present, the description element will be formatted to contain the field label and value using the following format string:

<b>{1}</b>: {2}<br/>
  • {0} - field name
  • {1} - field label
  • {2} - field value

This default format string can be overridden using the property glide.rss.description_format. An example of the formatted RSS feed can be seen in the following screen capture from Firefox:

Image:rss_format.png

Basic Authentication

To enforce basic authentication on each request for an RSS feed, you may set the property glide.basicauth.required.rss to true. RSS request would have to contain the "Authorization" header as specified in the Basic Authentication protocol. Because the request is non-interactive, we always require the Authorization header during a request.

Note
Note: If you plan to disable RSS basic authentication, make sure that tables in the platform have the right ACL entries to protect from unauthorized access


In Firefox 2.0, to specify basic authentication on the URL, put the username/password pair separated by ":" in front of the server name before an "@" character, for example, to use the demo credentials for itil to read the feed on our demo server:

 https://itil:[email protected]<instance name>.service-now.com/incident.do?RSS

Microsoft IE 7 does not support direct URL authentication http://support.microsoft.com/kb/834489 . If the Web site uses the basic authentication method, Internet Explorer automatically prompts users for a user name and a password. In some cases, users can click the Remember my password box in the dialog box to save their credentials for later visits to that Web site.

Overriding the RSS title

You may also optionally override the automatically generated "title" of the RSS feed by introducing sysparm_title parameter to the request URL. For example:

 https://<instance name>.service-now.com/incident.do?sysparm_query=priority=1&sysparm_view=ess&RSS&sysparm_title=Priority%20One%20Incidents


This will produce results as follows:

Image:rss_out.jpg

RSS Feed Readers

To render RSS data properly, one must use an RSS reader. There are RSS readers available in IE7 and Outlook 2007. Here is the IE7 link for reading RSS http://www.microsoft.com/windows/IE/ie7/tour/rss/.