Security Incident Catalog Categories not listed on Service Portal for an End User

SanjivMeher
Mega Patron

I have created a portal for Security Incident. I am trying to use the sc categories widget to display the categories. When I login as an admin, I am able to see the category, but when I login as an end user, I dont see any category at all.

I cloned the OOB widget and tried adding few debug statements. It seems like the Scripted REST API doesn't return any category 

var getCatalogCategories = "/api/sn_sc/servicecatalog/catalogs/" + $scope.data.sc_catalog + "/categories?sysparm_top_level_only=" + ($scope.options.category_layout === "Nested");
$http({method: 'GET', url: getCatalogCategories}).

But when I login as an admin, it returns the required categories. What could be the reason? I don't see any issue with ACLs as well

find_real_file.png


Please mark this response as correct or helpful if it assisted you with your question.
1 ACCEPTED SOLUTION

Ed Morris
Giga Contributor

I got it to work in:

Build name: Kingston
Build date: 06-21-2018_1724
Build tag: glide-kingston-10-17-2017__patch7-06-12-2018

As you already mentioned clone the OOB widgets. But you should also clone the page.

I will reference line numbers which pertain to the attached image.

The details for MODS to Categories AND Category Page are listed below. 

I hope this helps. 

Categories  

  1. Line 10. I was getting an error for JSUtil which was setting the categoryId variable. I commented it out and replaced with the empty string. Per screens below categoryId is used if the category has subcategories but OOB Incident Portal does not contain any subcategories. (second image) if you have subcategories you will need to pull the categoryID.  It might be in the variable 'categoryJS' (Line 71) but if it is not you should be able to pull it from GlideRecord. 
  2. Line 20. The call to '!catalog.canView()' was evaluating to true. The entire if statement was commented out. 
  3. Line 49. Another JSUtil error. The call was used to set the variable 'windowSize' but if you look a few lines above at Line 43 the 'windowSize' can be set as an option so that commented out with no replacement. 
  4. Update the client script code as follows

find_real_file.png

find_real_file.png

 

Category Page:

  1. Line 13 -20. The call to 'GlideStringUtil' is not allowed within the application scoped widget i.e. the cloned page widget. So what was commented out because for  my purpose I just to display the category items.  
  2. Line 35. The call to 'var scRecord = new sn_sc.CatalogSearch().search(catalog, categoryId, '', false, options.show_items_from_child != 'true');' Replaced lines 35 - 40 with code in Line 42-44. 

find_real_file.png

View solution in original post

4 REPLIES 4

SanjivMeher
Mega Patron

Anyone?


Please mark this response as correct or helpful if it assisted you with your question.

Ed Morris
Giga Contributor

I got it to work in:

Build name: Kingston
Build date: 06-21-2018_1724
Build tag: glide-kingston-10-17-2017__patch7-06-12-2018

As you already mentioned clone the OOB widgets. But you should also clone the page.

I will reference line numbers which pertain to the attached image.

The details for MODS to Categories AND Category Page are listed below. 

I hope this helps. 

Categories  

  1. Line 10. I was getting an error for JSUtil which was setting the categoryId variable. I commented it out and replaced with the empty string. Per screens below categoryId is used if the category has subcategories but OOB Incident Portal does not contain any subcategories. (second image) if you have subcategories you will need to pull the categoryID.  It might be in the variable 'categoryJS' (Line 71) but if it is not you should be able to pull it from GlideRecord. 
  2. Line 20. The call to '!catalog.canView()' was evaluating to true. The entire if statement was commented out. 
  3. Line 49. Another JSUtil error. The call was used to set the variable 'windowSize' but if you look a few lines above at Line 43 the 'windowSize' can be set as an option so that commented out with no replacement. 
  4. Update the client script code as follows

find_real_file.png

find_real_file.png

 

Category Page:

  1. Line 13 -20. The call to 'GlideStringUtil' is not allowed within the application scoped widget i.e. the cloned page widget. So what was commented out because for  my purpose I just to display the category items.  
  2. Line 35. The call to 'var scRecord = new sn_sc.CatalogSearch().search(catalog, categoryId, '', false, options.show_items_from_child != 'true');' Replaced lines 35 - 40 with code in Line 42-44. 

find_real_file.png

mazhar4
Giga Expert

Check if the categories are restricted to any group/role. 

 

Go to Maintain Categories in the navigation menu and select your category.

P.S: Please mark the answer as correct if it has solved your issue

Gazal Varshney2
Tera Contributor

Hi,

Can you please provide OOB widget you cloned to configure Security Incident Catalogs to Service portal.

Thanks,

Gazal