Add Risk Assessment Button to Service Portal Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2023 05:36 PM
Our Service Portal has a data table widget for the Change Request table. Some users create changes via a record producer in the portal.
I want to redirect them to automatically be presented with the risk assessment after the creation
AND/OR have the Risk Assessment accessible via a button on the Change Request form in the portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2023 05:47 PM
Either way will work but to save them an extra click you can use "producer.portal_redirect=" in the script portion on the Record Producer record and give it the value of the path to the page.
ServiceNow documentation reference: https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2023 05:53 PM
How do I construct the link to the Risk Assessment? Having the record producer link to the Service Portal Form for the Change is working. The issue is, I am not able to access the Risk Assessment UI Action in the form due to the client box being selected by default.
I am trying to determine how to launch or route users to the Change Risk Assessment screen relating to the CR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-01-2023 06:31 PM
Ah I see. I think I didn't really assess what you're asking here because I imagine that the Risk Assessment wouldn't be created until after the form is submitted and by then it has already passed the point of the redirect.
So, I guess a button will have to do from the Change Request form. For a button you will need to use a custom widget. You should be able to leverage data from the URL such as the sys_id of the Change Request being viewed. This is accomplished by using $sp.getParameter('sys_id') in the server script of the widget.
From there you should be able to use a GlideRecord script to find the Risk Assessment associated to the Change Request. With that information then build the url using variables so that it is dynamic. If you post an example of a URL to a Risk Assessment, I can help formulate that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2023 11:25 AM
Hello Chris,
I extracted the URL for the risk assessment screen by inspecting the element and retrieved the following URL:
https://______.servicenowservices.com/assessment_take2.do?sysparm_assessable_sysid=bd05ce9987bfad10d...
I created an HTML button that routes to it, which works, but the issue is when the submit button is clicked on the new screen it doesn't redirect back.