Assessment Creation API and Assessment Instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2018 02:05 PM
I'm able to create assessable records using the AssessmentCreation API from a business rule. However, this doesn't create the assessment instances with assigned users. You would have to manually assigned the users to each assessable record. Has anyone found a way to use the api to create both the assessable record and assign it automatically through a script or UI action ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2018 10:31 PM
If you look at the business rule, 'Create OnDemand Assessment' on the dmn_demand table, it shows an example of getting userIds from the many-to-many stakeholders table for the current demand. The list of userIds is passed to createAssessments(), with syntax as follows:
(SNC.AssessmentCreation()).createAssessments(
'0556fa9a8f12110040f82ab2f0f923f8', //sys_id of metric type Demand.. you could pass any other metric type you wish to create
current.sys_id, // sys_id of Demand to use
userIds, // comma separated list of user sys_ids
false, // check the users authorization before allowing them to take the survey
""); // sys_id of an existing assessment_group to use