- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2018 04:36 PM
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
Please mark this response as correct or helpful if it assisted you with your question.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2018 05:14 AM
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
- 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.
- Line 20. The call to '!catalog.canView()' was evaluating to true. The entire if statement was commented out.
- 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.
- Update the client script code as follows
Category Page:
- 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.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2018 09:32 AM
Anyone?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2018 05:14 AM
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
- 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.
- Line 20. The call to '!catalog.canView()' was evaluating to true. The entire if statement was commented out.
- 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.
- Update the client script code as follows
Category Page:
- 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.
- 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-15-2018 05:46 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2020 05:15 AM
Hi,
Can you please provide OOB widget you cloned to configure Security Incident Catalogs to Service portal.
Thanks,
Gazal