Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Regarding standard change

AmitK1382912422
Tera Contributor

Hi everyone,

this discussion is about retrieving the assignment group value from standard change templates.

Given that we have the standard change proposal numbers, is there any out-of-the-box functionality available to extract the assignment group value directly from the template using just the proposal number.

 

 

 

@Ankur Bawiskar 

3 REPLIES 3

ChallaR
Mega Guru

Hi @AmitK1382912422 , 

yes we do have OOTB functionality -

Out-of-the-Box Behavior

There is no direct out-of-the-box field mapping from the Standard Change Template to the Standard Change Proposal that automatically pulls the assignment group. However, you can achieve this using:

1. Dot-Walking in Client Script

If the Standard Change Proposal is linked to the Template, you can use dot-walking to access the assignment group:

 

var template = g_form.getReference('standard_change_template', function(ref) {
    if (ref.assignment_group) {
        g_form.setValue('assignment_group', ref.assignment_group);
    }
});

 

This assumes:

  • The proposal form has a reference field to the template.
  • The template has the assignment_group field populated.

2. Assignment Rules

You can configure an Assignment Rule for the std_change_proposal table to set the assignment group based on the template or other logic. [servicenow.com]

3. Form Layout Configuration

If the assignment group is part of the Change Request Values section in the template, you can expose it in the proposal form by configuring the form layout. [servicenow.com]


 Implementation Tips

  • Ensure the proposal form has a reference to the template.
  • Use GlideAjax or Client Scripts to fetch and populate the assignment group dynamically.
  • Consider using UI Policies or Business Rules if you need server-side enforcement.

Please as correct  if this is helpful and close the thread.

 

Thanks,

Rithika.ch 

Me Being Mustaq
Giga Guru
Hi @AmitK1382912422 ,
 
There is no direct out‑of‑the‑box (OOB) API or function that retrieves the assignment group from a Standard Change Template using only the Standard Change Proposal number. This is because ServiceNow stores the change template’s “Change Request Values” (including assignment group, description, risk, etc.) as encoded XML within the template field of the std_change_template table — not as discrete relational fields.
However, ServiceNow provides supported ways to extract that data programmatically, following best practices outlined by the platform and community:

Why It’s Not OOB

  • Standard change proposals (std_change_proposal) reference templates by sys_id.
  • The Change Request Values section of templates is stored as serialized XML, containing <template_value> tags like <assignment_group>.
  • The system doesn’t automatically decode these into fields accessible by dot‑walking or Glide API.​

1. Use Script to Parse Template Field

A GlideRecord query and XML parsing pattern is commonly used to retrieve details.
For example:
(function() {
var proposal = new GlideRecord('std_change_proposal');
if (proposal.get('number', 'CHGPRO0012345')) { // replace with your proposal number
var templateGR = new GlideRecord('std_change_template');
templateGR.addQuery('sys_id', proposal.std_change_template);
templateGR.query();
if (templateGR.next()) {
var xmlString = templateGR.template.toString();
var match = xmlString.match(/assignment_group=([0-9a-fA-F]{32})/);
if (match && match[1]) {
var group = new GlideRecord('sys_user_group');
if (group.get(match[1])) {
gs.info('Assignment group: ' + group.name);
}
}
}
}
})();
This works because the field template stores the encoded values in a string format (e.g., assignment_group=46d44f37c0a8016401caa27f1ab80930^), which can be extracted reliably.
 

2. Use Data Lookup or Assignment Rule

An alternative configuration-based approach is to define a Data Lookup Definition or Assignment Rule on the std_change_proposal table that dynamically looks up and sets the assignment_group based on the linked std_change_template.​
Path: System Policy → Rules → Assignment → Standard Change Proposal.

3. Use Proposal Workflow Logic

In cases where proposals trigger workflows, you can modify the workflow to fetch the template record and set the assignment group on the proposal or subsequent change record. This is typically where CAB approval routing is handled.
 
In summary, ServiceNow does not provide an OOB function to pull the assignment group from a Standard Change Template using the proposal number alone. You can, however, script it or configure an assignment rule to decode and propagate that value automatically during proposal or template creation
you may find below thread helpful:

 

please mark the answer as correct and helpful based on the impact!!

 

Kind Regards,

Shaik Mohammed Mustaq

Thanks & Regards,

Mohammed Mustaq Shaik

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @AmitK1382912422 

Being  a BPC, my first question is: what’s the use case for you to get the assignment group and other related values? What exactly are you planning to do with them, and where do you intend to use this information?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************