Home Self-Service Portal - Community

Showing certain service offerings

Ozge_OzkayaOzge_Ozkaya Member Adept IT Monkey ✭✭
Dears,

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

  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Yes, since you can get your service offerings and request offerings from the API, and then you can write your own Javascript to display them on this custom page of yours, as you see fit.

    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!
  • Ozge_OzkayaOzge_Ozkaya Member Adept IT Monkey ✭✭
    Dear Tom,

    Can you guide me how to start writing the JS to display the SO?

    Kind regards.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Without diving into actual code, which would take more time than I am able to offer right now, it would look something like this at a high level:

    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):

    $.get("/api/V3/ServiceCatalog/GetServiceCatalog",
      data: { userId: session.user.Id, isScoped: false},
      function (data) {
        // for each RO...not writing that out atm
        if (data.ServiceOfferingId == '<<GUID of your Service Offering Here>>') {
          // Write the properties of each Request Offering to the page however you see fit... in a table, UL, etc.
        }
      }
    });

    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.

  • Ozge_OzkayaOzge_Ozkaya Member Adept IT Monkey ✭✭
    Dear @Tom_Hendricks, would it be possible to show only the catalog items that are belong to Incident Work Item class? My idea here is to separate Incidents from Service Requests.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    You should check out the API documentation which is at [your portal url]/Help/

    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_RossGeoff_Ross Cireson Consultant O.G.
    Maybe not what you were asking but a possible simpler way would be to use two of the three SMPOOB (Service Manager Portal Out of Box) homepages, and customise them to hide what you don't want.

    Geoff
Sign In or Register to comment.