- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I have a survey I want to trigger every quarter for members of a particular group.
On the related list of my Survey Definition [asmt_metric_type], I can add trigger conditions, however these seem to require specific events to trigger.
On the Survey Definition record itself, there is the Schedule Period field, but this does not allow anything between monthly and yearly.
What is the solution here?
Regards,
Kim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
The problem is, I did not read the docs carefully enough and I did not realize there is a difference between assessments and surveys.
It says that the second parameter is ONLY for use with assessments. My "assessment" is actually a survey, so the second parameter should be left blank. Thus in my scheduled script:
triggerSurvey();
function triggerSurvey() {
try {
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", "2ccabcccaf3d6a10e8f667caa6274980"); //Group SysID
gr.query();
while (gr.next()) {
new SNC.AssessmentCreation().createAssessments('37b85f99af99ba1056b7a2c651274978' */My survey definition*/, '', gr.user);
}
} catch (ex) {
gs.info(ex);
}
}
Works like a charm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
the 2nd parameter means the record against which Assessment should be raised.
seems the docs are confusing.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Sorry for the drawn-out thread, but what is this record "against which Assessment should be raised"? Is it simply the record from which to retrieve the user for a particular Assessment Instance?
In any case I don't know how to solve this, may end up having to raise a support ticket. Tried solving the errors I posted above through this Support KB but to no avail.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0961711
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
The problem is, I did not read the docs carefully enough and I did not realize there is a difference between assessments and surveys.
It says that the second parameter is ONLY for use with assessments. My "assessment" is actually a survey, so the second parameter should be left blank. Thus in my scheduled script:
triggerSurvey();
function triggerSurvey() {
try {
var gr = new GlideRecord("sys_user_grmember");
gr.addQuery("group", "2ccabcccaf3d6a10e8f667caa6274980"); //Group SysID
gr.query();
while (gr.next()) {
new SNC.AssessmentCreation().createAssessments('37b85f99af99ba1056b7a2c651274978' */My survey definition*/, '', gr.user);
}
} catch (ex) {
gs.info(ex);
}
}
Works like a charm.
