- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2018 08:03 PM
Hi all,
I'm looking at setting up a processor that allows shorter URL's to KB articles. I was wondering if there's a good way to allow external access (Via ACL?) to a specific processor?
Background
Links to our KB articles currently look like:
https://instancename.service-now.com/csm?id=kb_article&sys_id=7abc123odadoiwagbdwaiohvsuicpoe6
I've got a processor which shortens the links to:
https://instancename.service-now.com/help?article=KB00001
The marketing department will be much happier pasting this into their social media links!
The Processor
It's a relatively simple thing that executes the following:
(function process(g_request, g_response, g_processor) {
var article = g_request.getParameter("article");
//Query table for Knowledge article
var kb = new GlideRecord('kb_knowledge');
kb.addQuery('number', article); //Key, query value
kb.query();
//Default url if not found
var url = 'https://devinstance.service-now.com/csm';
//While we have results
while (kb.next()) {
if (kb.number.toString() == article.toString()){
url = url + '?id=kb_article&sys_id=' + kb.sys_id.toString();
}
}
//Redrect to base csm addr or found kb article
g_processor.redirect(url);
})(g_request, g_response, g_processor);
The CSM endpoint is accessible by external users, they don't need to be logged in to navigate the service portal and read KB and News articles.
However, this processor is set up in the global namespace with the previously mentioned /help endpoint.
Navigating to <instance.com>/help requires a user to log in.
Is there a safe way to enable access to this specific endpoint for external users?
Any comments are appreciated!
Regards,
David
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2018 06:23 AM
Got it.
to make the processor public you need to do 1 or 2 things. If you don't have CSM or any other application that might activate the snc_internal/snc_external roles then you just need step 1.
1. Create the processor, go to sys_public.list and add the path there. Then in the url use <path>.do and it will work.
2. if you have the snc-roles thingie. Then you also need to edit the roles field on the processor. Now this isn't visible from start and ServiceNow has been kind to add the role snc_internal there by default which of course the none loggedin user doesn't have. Here you need to remove that and then add the role public instead.
Then it should work :). I think I'll make a video of this 🙂 and steal your idea about it 😉
//Göran

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-28-2019 09:11 PM
Hi Goran,
Even after making the above 2 changes
1)Adding the path in sys_public.list
2) and setting role to Public.
I am being asked to log into the SSO. I am currently in Madrid release.
Can you please help me where I am going wrong.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2023 08:53 AM
Hello Goran,
Is the use of processors in SN UTAH version still valid method for shortening KB URL's? If not, what is the preferred method now and what is an example of using that new method?
Found that this feature is deprecated in research, https://docs.servicenow.com/bundle/utah-application-development/page/script/processors/concept/c_Pro...
Thanks!