Setting the Assignment Group of a Record Producer from a Select Box variable

RRolling
Tera Guru

As the title says, I'm looking to set the Assignment Group of an Incident (record producer) from a select box variable that has two options.

Select Box is checked to Map to Field the assignment group and that doesn't work.

Ive also tried current.assignment_group = producer.assignment_group.setDisplayValue();

and 

var HD = producer.assignment_group.getDisplayValue();

current.assignment_group = HD.string();

 

t seems to know the value correctly but doesn't want to set the Assignment Group.

Any Ideas?

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,

You should be using setDisplayValue().  Can you try the following and see if it works

 

current.assignment_group.setDisplayValue(producer.assignment_group);

https://docs.servicenow.com/bundle/istanbul-platform-administration/page/administer/task-table/refer...

Thanks!

View solution in original post

4 REPLIES 4

puneetgoels1
Tera Guru

try putting gs.addInfoMessage and check if there producer.assignment_group.getDisplayValue() returns a value

rajneeshbaranwa
Giga Guru

I think you should be setting the value (Not label) of choice group field as sys_id of the assignment group 

and then use current.assignment_group = producer.assignment_group 

 

or 

use if condition as you have only 2 assignment group options.

something like below

if (producer.assignment_group == "A")

current.assignment_group = {Sys_ID of group A}

if (producer.assignment_group == "B")

current.assignment_group = {Sys_ID of group B}

This should work for you

 

 

Alikutty A
Tera Sage

Hi,

You should be using setDisplayValue().  Can you try the following and see if it works

 

current.assignment_group.setDisplayValue(producer.assignment_group);

https://docs.servicenow.com/bundle/istanbul-platform-administration/page/administer/task-table/refer...

Thanks!

We got a winner!

 

Thanks. I wasn't even thinking about setting it from current only the producer side.