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

Is there somewhere we can view of the code for the class, even read-only? I'm trying to use the class to create some assessments and it would help in troubleshooting why my assessments aren't getting created



Thanks!


There's no supported means that I'm aware of to get the methods from that class. While it would be nice if every class were documented to the fullest, there are reasons why the developers do not (some of them are even valid. )



You shouldn't need any scripting to use Assessments OOB.



Administrator tasks


I thought that might be the case.. but doesn't hurt to ask Thanks for the quick response! I am trying to add some customization to demand management to manually trigger assessments, which is why I'm trying to dig into how the class works.



I did find some documentation on the methods and parameters, if anyone else is looking for how to use this class: http://wiki.servicenow.com/index.php?title=GlideAssessmentCreation_API_Reference#gsc.tab=0



Best,


Thanks for sharing Daniel!


Hi Chuck,



What is the best or good method(s) in obtain a User value from another table? (e.g., on the Release form we want to display the Portfolio Manager from the Portfolio table, Product Business Owner (custom sys_user field) and Product Owner (product_owner) from the Product table.



javascript:'roles='+SNC.PPMConfig.getBusinessOwner(current.getTableName()) is working for Portfolio Manager but as you mention, not recommended to use this method.   (see Picture #1)



I have had success with javascript:gs.getUser().getUserByID(current.caller_id).getManagerName()||''; in Default field of reference field. (see Picure #2)



I have also tried dot.walking the fields from the Product table but they are not populating with the Product Name is entered on the Release form. So I am stumped on how to capture/pull this information?



Picture #1


Capture #1.JPG



Picture #2


Capture #2.JPG



Thank you,


-Wesley