dynamic populate the assignment group based on condition.

biplab
Tera Contributor

I have a true/false field in incident form called security related incident. I want to populate only two assignment group in assignment group reference field when the security related incident checkbox is true.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@biplab 

so you want to apply reference qualifier on assignment group field

you need to use Dictionary override on Assignment Group field as it's on task level and have the logic checked there

Something like this

Give the field name, group sysIds

javascript: var query ='' ; if(current.field.toString() == 'true') query = 'sys_idINGroupSysId1,GroupSysId2';  query;

AnkurBawiskar_0-1730815571394.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Animesh Das2
Mega Sage

Hi @biplab,

 

You can create a server side script include (Not a client callable one) and write the logic there inside the script include function as,

 

var YourScriptInclude = Class.create();
    YourScriptInclude.prototype = {
    initialize: function() {},

yourFunctionName: function(yourSecurityFieldValue) {
    if(yourSecurityFieldValue == 'true');
    return  'sys_idINGroup1SysId,Group2SysId';
    },
    type: 'YourScriptInclude'
};

 

Then you can configure the 'Dictionary override' on 'Assignment Group' field as it is inherited from 'Task' table and call the script include function in the Reference qualifier as below,

 

AnimeshDas2_0-1730822464344.png

 

 

 

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das

hello @Animesh Das2 
I have already a dictionary override in the same table and field. Its not allow me to write another.

 

thanks

Hi @biplab ,

If you already have a dictionary override for assignment group on incident table by overriding the 'reference qualifier' then you need to modify that reference qualifier only rather than creating a new one.

 

If this address your question, please mark this response correct by clicking on Accept as Solution and/or Kudos.

You may mark this helpful as well if it helps you.

Thanks, 

Animesh Das