How To: Producing OData Queries and Examples

Exploring OData

The Cireson Platform exposes data in your environment through the Open Data Protocol or OData for short. With OData you have a common way to update and consume data in your Service Manager environment from any number of tools such as Excel, PowerBI, or SharePoint. OData also provides a simple way to filter data to expose it through OData Widgets or through Global Search available on the Portal.

You can use your own platform to get started quickly. Just navigate to http://localhost/platform/api/ where localhost is the name of your Cireson portal server (SSL configurations are supported should you prefer to use HTTPS). Here you can browse the Classes syncing into the platform, as well as their "URL" property. You can use this to build URLs such as:

http://localhost/platform/api/Cached_MT_System_FileAttachment 
http://localhost/platform/api/Cached_MT_System_WorkItem_Incident
http://localhost/platform/api/Cached_MT_System_WorkItem_Problem
http://localhost/platform/api/Cached_MT_System_WorkItem_TroubleTicket_AnalystCommentLog 

With each new URL constructed, you can navigate to it to view that particular dataset, its properties, values, and use that information to construct OData filters unique to your environment. Take the following examples:

Filter Examples

Knowledge Articles

LocaleID eq '{{languageCode}}' and StatusStringId eq {{publishedArticleStatusId}}

Incidents

LanguageCode eq '{{languageCode}}' and Status eq 'Closed'
LanguageCode eq '{{languageCode}}' and StatusId eq 'bd0ae7c4-3315-2eb3-7933-82dfc482dbaf'

Analyst Comments

LanguageCode eq '{{languageCode}}' and IsPrivate eq false

File Attachments

LanguageCode eq '{{languageCode}}' and Size gt 5000

Hardware Assets (requires Cireson Asset Management)

LanguageCode eq '{{languageCode}}' and HardwareAssetStatus ne 'Retired'

LanguageCode eq '{{languageCode}}' and HardwareAssetStatus in ('Deployed', 'Loaned', 'In Stock')

Azure Resource Groups (requires configured Azure Monitoring via Operations Manager)

LanguageCode eq '{{languageCode}}' and ObjectStatus eq 'Active'

 

Additional Resources

Microsoft Article on OData Querying

https://docs.microsoft.com/en-us/odata/concepts/queryoptions-overview

Â