Assignment Group in Standard Change Template

karthikbunny
Kilo Explorer

Hi experts,

The Assignment group in the Standard Change template is not working as same as on the Change form.

The Assignment Group in the change form shows few user groups as below.

find_real_file.png

But the user groups in the Standard Change Template shows all user groups.

find_real_file.png

How to make these sync? Any suggestions are much appreciated.

 

Thanks,

Karthik babu.

1 ACCEPTED SOLUTION

Murali krishna3
Mega Guru

Hi Karthik,

 

I misunderstood your post initially. I got your issue now. you need to write a Before query business rule on Groups table(sys_user_group) as shown below.

 

(function executeRule(current, previous /*null when async*/) {

var targetName = gs.action.getGlideURI().getMap().get('sysparm_target');
if (targetName.indexOf('change_request.assignment_group') > -1) {
current.addEncodedQuery('Your Query'); // installed
}

})(current, previous);

 

When you click the magnifying glass, there is a parameter in URL sysparm_target that always differ a little bit. On the change form it's just change_request.assignment_group, and all the reference qualifiers but on change proposal, it has format like change_request.assignment_group.{sys_id format}, it doesn't have qualifiers. Above script helps you add the qualifier to the URL so that you can match the assignment group list both on the standard change template and change request form 

 

Mark it as correct if it is helpful.

 

BR,

Murali Krishna

View solution in original post

6 REPLIES 6

Divya Kandula
Kilo Guru

I have added below validation before entering the code

var url1 = gs.action;
if (url1 != null && url1 != '') { // validation for INC0XXXXX as gs.action is not found
var targetName = gs.action.getGlideURI().getMap().get('sysparm_target');
if (targetName != null && targetName != '') {

----}

jonmulherin
Giga Expert

Hi.  I was able to use the solution above to properly populate the value of a reference field, u_gc_ct_impacted.  I have another variable on the template that needs to reference the value selected in u_gc_ct_impacted but have not come up with a way to do so.  Can anyone assist with this?  What I've tried:

 

var targetName = gs.action.getGlideURI().getMap().get('sysparm_target');
if (targetName.indexOf('change_request.u_ct_region_impacted') > -1) {
current.addEncodedQuery('u_type=Region^u_parentIN' + current.u_gc_ct_impacted);
}

 

var targetName = gs.action.getGlideURI().getMap().get('sysparm_target');
if (targetName.indexOf('change_request.u_ct_region_impacted') > -1) {
current.addEncodedQuery('u_type=Region^u_parentIN' + current.change_request.u_gc_ct_impacted);
}

 

Thank You,

Jon