Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Relate Survey Instance to the Incident that triggered it

Cirrus
Kilo Sage

Good afternoon all,

I need some help please, possibly in two parts.

Firstly, I have a requirement to relate the survey instance to the incident that triggered it. I have referenced the following article: 

Survey Response as related list on record

Rather than create a new relationship between incident and asmt_metric_result, I need to create it between incident and asmt_assessment_instance, but when I apply the script my related list shows all survey instances.

find_real_file.png

What do I need to change on the code to match the survey instance to the trigger_id and show only this instance on the related list of the trigger id incident record.

find_real_file.png

 

And now for the second part. 

If the survey response requires further investigation, a case record will be opened. We already have a related list for Incident, so could easily select INC000073471 for example. But could we then query any instance against this trigger ID and add the assessment instance as a related list on the case?

Any help huch appreciated. 

1 ACCEPTED SOLUTION

Cirrus
Kilo Sage

Managed to resolve this using the following:

 

current.addQuery('task_id.parent', parent.sys_id.toString());

View solution in original post

3 REPLIES 3

Cirrus
Kilo Sage

Managed to resolve this using the following:

 

current.addQuery('task_id.parent', parent.sys_id.toString());

Community Alums
Not applicable

Managed to resolve this using the following code 

current.addQuery('trigger_id', parent.sys_id);

Community Alums
Not applicable

Managed to resolve this using the following code 

current.addQuery('trigger_id', parent.sys_id);