The CreatorCon Call for Content is officially open! Get started here.

Writing a Risk Assessment Answer Back to Change Form Field

stvillil
Kilo Contributor

Hi, I am trying to take an answer of Risk Assessment and populate that info back to a field on the Change Form. I found a couple of articles on the wiki that include details on Incident survey results, but can seem to make it work for change and risk assessment.

Thanks in advance for any help you can provide.

1 ACCEPTED SOLUTION

You can modify the '//now iterate the answers' section. Get the sys_id of the question you want to capture the result for, just add a couple of lines after -



var key = arg.substring('QUESTION:'.length);


Assuming that you just want the value of the answer (which is the text of the answer, not the score), something like this might do it.



var key = arg.substring('QUESTION:'.length);
//below is the sys_id of the question you want the answer to
if(key == 'ae168e6b9d40b0c015cb6a9aa0e40572'){
var cr = new GlideRecord('change_request');
cr.get(taskID);
cr.work_notes = value; //update whatever field you want, value is the value of the answer
cr.update();

}


View solution in original post

12 REPLIES 12

Thanks a lot Sekhar Great work...

Thank You Srikanth

Hi @sekhar kurumoju  , 

This is my requirement related to risk assessment .

https://community.servicenow.com/community?id=community_question&sys_id=2cb90ce8db714510ae8125091396...

Can you please help me with this requirement . 

Thanks in advance .