Record producer - How to populate 'Assignment Group' field with CI informations

Tamara Durand1
Kilo Contributor

Hello everyone !

A client asked me to create a Record Producer for declare an incident.

The "Assignment Group" field on the new incident record must be populated with the value of the "Owner Group" field of the chosen CI.

I think that I read all topics about how auto-populate fields on Record Producers, I tried some scripts in the Record Producer, I tried also to create an Assignment Rule, a Lookup Rule, a Client Script... But nothing works.

In my head I know that I have to pick the value of the "Owner Group" field from cmdb_ci table to put it on the "Assignment_Group" field in the incident table.

On the script frame of the Record Producer form, I tried stuff like "current.assignment_group = current.cmdb_ci.owner_group"

I tried also :

var assignmentGroup = new GlideRecord ('cmdb_ci');
assignmentGroup.query();
if (assignmentGroup.next()) {
current.cmdb_ci.owner_group;
task.setDisplayValue('assignment_group', current.cmdb_ci.owner_group);
assignmentGroup.update();

}

The lookup rule doesn't work because it only let me choose fields from variables or variable sets while I need to choose fields from cmdb_ci and incident tables.

I am new in SN and I am really blocked on this project so I really appreciate your help.

Thanks in advance.

Tamara

1 ACCEPTED SOLUTION

VigneshMC
Mega Sage

Below code should work

current.assignment_group = producer.<ci_field_name>.owner_group;

Thanks

View solution in original post

2 REPLIES 2

VigneshMC
Mega Sage

Below code should work

current.assignment_group = producer.<ci_field_name>.owner_group;

Thanks

Thank you so much ! Have a nice day 🙂