Surveys Trigger Condition Related Field - how to fill in the prepopulate past data?

zynsn
Tera Expert

Hi Developers,

 

We have a survey that is being triggered after an incident is closed. Now the business is asking to track the Incident's assigned to for reporting purposes on the Surveys. We have added the assigned to field to the Related Field 1 in the survey trigger condition. How do we prepopulate the past data so that we have the information on who was working on the incident ticket that the survey was sent out for?

 

The background script is not filling in the data. It returns empty on the field for the related_id_1 field.

var current = new GlideRecord("asmt_metric_result");
if (current.get("f941962b1bb5b150ad1220aa234bcbf6")){
  var user = current.instance.trigger_id.assigned_to;
  var gr = new GlideRecord("asmt_assessment_instance");
  gr.get(current.instance);
    gr.related_id_1 = user;
    gr.update();
}

Thanks.

1 REPLY 1

XvE
Tera Contributor

related_field_1|2|3|4 are document ID type fields, so you need to populate the related_table_1|2|3|4 as well in order for the "field" fields to know where to point to.