Where is SNC.AssessmentCreation() ?

adityavishnu
Giga Expert

I am trying to understand the below piece of code especially the first line in which an object is created. I understand it is creating a new assessment i don't understand below points.

1. Where is the AssessmentCreation()(i believe script include) is written? In my Script Include of my instance(Eureka) it is not available and how do i view the code written in AssessmentCreation() ?

2. What is the objective of SNC. ?

3. Can an admin in ServiceNow edit AssessmentCreation() ?

(new SNC.AssessmentCreation()).conditionTrigger(current, 'f4faa78a2b53e100e653224e59da157c');

  if(flag){

  var gropen = new GlideRecord('asmt_assessment_instance');

  gropen.addEncodedQuery(surveys);

  gropen.query();

  while(gropen.next()){

  gropen.state = 'ready';

  gropen.update();

  }

  }

t

16 REPLIES 16

Hi Chuck,



I have received below response from the Andy Venables, solution architect with the TPP team.



Having reviewed your issue (and associated community post), i believe the SNC.AssessmentCreation() is no longer intended to be called directly.

Instead a script include called AssessmentUtils is provided that acts as an interface for assessment functions. Specifically there is a "createAssessments" function that actually calls the underlining java code, because this script include is defined in global it acts as an interface for your scoped app.

I think you should be able to replace your code with the following:
new global.AssessmentUtils().createAssessments('c88c31a3dbee8340070cd001cf9619a5','',current.employee_name);

One other factor to consider is that it is intended (in normal operation) that you shouldn't need to call these APIs as assessments are designed to be script free. However there maybe aspects of your case that require it.


Thanks for sharing