
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â09-07-2018 01:17 PM
Hello all,
Recently I have been working on an enhancement that requests a survey to not require authentication for users. I realize that this is an out-of-box functionality (with the 'Public' option), but we require the incident that the survey is attached to to be attached to the survey (as the survey trigger id), and this is causing difficulty in fulfilling the enhancement requirements.
When an incident is resolved, a notification is triggered to the user with the link to a survey inside. I have developed this to the point where the script that generates the link also creates and inserts a new survey instance (see code):
The problem I have arises from the assessment_take2.do? UI page reference at the beginning of the url. When an unauthenticated user clicks the generated link, the UI page will automatically create a completely new survey instance with no trigger ID associated, via the method I have specified in the question title (see image below):
I have attempted to pull the sysparm_assessible_sysid AND the sysparm_trigger_id into the UI page, to no avail. The ServiceNow Documentation of the AssessmentCreation() method (Accessable here) does not mention this method. Thus I am blind as to what parameters to experiment with, or what output to expect.
Could anyone shed some light on this method, or perhaps suggest other ways to accomplish the goal I am attempting to reach?
Thank you!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- 3,738 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â09-07-2018 05:23 PM
Interesting requirement, also very clearly explained, I replicated the requirement and it seems to work for me, what I did is this:
- Took an existing survey and made it public
- I used a trigger condition to create an instance of the survey associated with a record and a user, this to simulate your script
- Navigated to asmt_assessment_instance.list then opened the newly created existing instance form and used the related link named "view instance URL", this provided a link in the correct format:
- Copied this URL and used it on a different unlogged browser and was able to close it without it creating another one
The format that seems to work is this:
https://<yourInstance>.service-now.com/nav_to.do?uri=assessment_take2.do%3Fsysparm_assessable_type=87186844d7211100158ba6859e610378%26sysparm_assessable_sysid=c3b76757db1023007837560868961909
hope this helps,
David

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â09-07-2018 05:23 PM
Interesting requirement, also very clearly explained, I replicated the requirement and it seems to work for me, what I did is this:
- Took an existing survey and made it public
- I used a trigger condition to create an instance of the survey associated with a record and a user, this to simulate your script
- Navigated to asmt_assessment_instance.list then opened the newly created existing instance form and used the related link named "view instance URL", this provided a link in the correct format:
- Copied this URL and used it on a different unlogged browser and was able to close it without it creating another one
The format that seems to work is this:
https://<yourInstance>.service-now.com/nav_to.do?uri=assessment_take2.do%3Fsysparm_assessable_type=87186844d7211100158ba6859e610378%26sysparm_assessable_sysid=c3b76757db1023007837560868961909
hope this helps,
David

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â09-19-2018 11:59 AM
David,
Thank you for your reply. The trigger condition was the missing link; once I had that in place, I was able to grab the Assessment Instance link with this code:
var gr = new GlideRecord('asmt_assessment_instance');
gr.addQuery('trigger_id', current.sys_id);
gr.query();
if(gr.next()){
var assessmentID = gr.sys_id;
var link = new AssessmentUtils().getAssessmentInstanceURL(assessmentID);
}
Your assistance is much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â01-02-2025 07:12 AM
Hi @Michael Lorincz ! I know this is an old thread but Im facing same issues here.
Where did you place that first code you mentioned ? Is that a email script?
Also, are you just triggering a notification when the "INC is resolved/closed", with the email script on it?.
Thanks a lot!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â09-07-2018 05:26 PM
Also in the past, I had to create a custom clone of the assessment_take2 UI Page to achieve some very specific requirements, and this is something you could do if really needed, but I would consider it a last resource due to upgradability issues.