How to set a field value on Incident Form with an 'New' UI action which is a related list button

ppp4
Tera Contributor

Hello Team,

 

I have related list on cmdb CI Form , which shows the list of Incidents of that respective CI. This related list have a 'New' UI action on it (runs on server side only) , which redirects to a new Incident creation form .When we click on that UI action , CI will be automatically set on incident. Along with the CI , i want to auto populate the Assignment Group. Please help.

1 ACCEPTED SOLUTION

Pavankumar_1
Mega Patron

Hi @ppp4 ,

That  relation was build because on incident we have the cmdb_ci reference field. You can't modify or find it.

If you need to set assignment group go with custom relationship you can set the values on it.

Refer below relationship

(function refineQuery(current, parent) {
    current.addQuery('cmdb_ci', parent.sys_id); //it will set the Configuration item
    current.addQuery('assignment_group', '0a52d3dcd7011200f2d224837e6103f2'); //set the assignment group
	//current.addQuery('description', parent.asset_tag);//set asset tag
})(current, parent);

Screenshot (737).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

1 REPLY 1

Pavankumar_1
Mega Patron

Hi @ppp4 ,

That  relation was build because on incident we have the cmdb_ci reference field. You can't modify or find it.

If you need to set assignment group go with custom relationship you can set the values on it.

Refer below relationship

(function refineQuery(current, parent) {
    current.addQuery('cmdb_ci', parent.sys_id); //it will set the Configuration item
    current.addQuery('assignment_group', '0a52d3dcd7011200f2d224837e6103f2'); //set the assignment group
	//current.addQuery('description', parent.asset_tag);//set asset tag
})(current, parent);

Screenshot (737).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar