Showing certain service offerings
Is it possible to create a page and display certain service offerings on that page? By default all service offerings that are created in the console are displayed in the portal.
Let's say we have IT and HR as service offering categories. I would like to display them separately in 2 different pages.
Thanks in advance.
Answers
If your question was about an out-of-box way of doing this, I am not aware of one. It might make a good feature request, though!
Can you guide me how to start writing the JS to display the SO?
Kind regards.
Get the service offering that you wish to display by its ID, which would look similar to (this will not run, it is pseudo code):
There are probably other services not documented in the API that would be even easier to make use of, but this is one that I know off the top of my head. Perhaps others can comment on better methods of accomplishing this, but I hope this can at least get you started on the right path.
The endpoint I shared above does not return information about whether or not the request offerings are IR or SRs. You could loop through the results and look up each one with subsequent web calls, but that could ruin performance on the page.
Perhaps a better way to do this is to use the /api/V3/ServiceCatalog/Search?searchText={searchText}&searchType={searchType} endpoint (documentation is at [your portal url]/Help/Api/GET-api-V3-ServiceCatalog-Search_searchText_searchType_skipCount_takeCount). The advantage is that you can specify searchType of "Incidents" or "Request" (also "Favorites" or "All") to narrow things down. There are disadvantages, however. It will not work with Change Requests, I am not aware of a way to have it return all results (i.e. "Search All" or "*"), and the search results are not very accurate in my experience.
Geoff