Auto-Populate Assignment Group in ServiceNow SC Tasks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 03:54 AM
Hello everyone,
I have a requirement in ServiceNow that I need help with. I'll explain the scenario and hope to get a solution based on this.
I have 10 Service Catalog (SC) tasks, each with different assignment group variables in the "Case Details" tab of the catalog task. The variables are named as follows:
- Assignment group for resource task (grp_resource_task)
- Assignment group for validation task (grp_validation_task)
- Assignment group for build task task (grp_build_task) ...and so on for all 10 SC tasks.
Each catalog task has the same type of condition, and there are 6 assignment groups configured at the variable level for this "Case Details" tab of the catalog task assignment group. This part is working fine.
Requirement:
The selected group in the SC task "Case Details" tab variable should auto-populate in the SC task "Ownership" tab (assignment group). Initially, the assignment group is blank in the "Ownership" tab, which is an out-of-the-box (OOTB) mandatory field.
Issue:
- Initially, the "Ownership" tab assignment group is empty for each SC task, and this is an OOTB mandatory field.
- When I select the assignment group in the "Case Details" tab variable, it does not auto-populate in the "Ownership" tab assignment group.
- Saving the form without filling the "Ownership" tab assignment group is not possible because it is a mandatory field.
For example, if I choose the assignment group as "Noc L2" in the "Case Details" tab variable for a resource SC task, it should automatically populate the same assignment group in the resource SC task "Ownership" tab.
I tried using the workflow like:
task.assignment_group = current.variables.grp_resource_task;
but this is not working. I am unable to populate the assignment group in the "Ownership" tab assignment group.
How can I achieve this requirement? Please provide a correct solution so that I can implement it.
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2025 08:00 AM
So many questions here...
First of all, assignment_group is not mandatory OOTB on the sc_task table. So if it's mandatory for you, that's a customization.
Next, you mentioned workflow. Best practice is to be using Flow. With that being said, your line of code is correct and should be working from a workflow. Have you verified that whatever group you are selecting in your variable is eligible to be added to the assignment_group field? Check and make sure it's got the type 'itil'. If it doesn't, that could be why it's not saving that assignment. You also may have other customizations on the assignment_group variable, further restricting it. Check that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 10:02 PM
Ive been trying to use Workflow studio to allocate the assignment group that is captured from a catalog variable that is capture from another ticket number. But the assignment group field doesn't seem to be picking up the details from the variable.
Any suggestion?:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2025 11:00 PM
Use a Catalog Task Business Rule on the sc_task table that:
Identifies which Catalog Task type it is (e.g., “Resource Task”, “Build Task”).
Pulls the matching assignment group variable (like grp_resource_task) from the parent RITM.
Populates the assignment_group field.
Step-by-Step Implementation
Step 1: Ensure Variables Are on RITM
Make sure that the assignment group variables (like grp_resource_task, grp_validation_task, etc.) are stored at the RITM level, not just on the Catalog Task.
In the Variable Configuration, make sure "Global = false" and "Question = true" on the main item.
These variables will then be accessible via current.request_item.variables.grp_resource_task.
Step 2: Create a Business Rule on sc_task
Table: sc_task
When: Before
Insert: True
Update: False
Condition: current.assignment_group.nil()
Script
(function executeRule(current, gsr) {
var ritm = current.request_item;
if (!ritm) return;
// Determine which task type this is (e.g., based on task name or short description)
var shortDesc = current.short_description.toLowerCase();
if (shortDesc.includes("resource")) {
current.assignment_group = ritm.variables.grp_resource_task;
} else if (shortDesc.includes("validation")) {
current.assignment_group = ritm.variables.grp_validation_task;
} else if (shortDesc.includes("build")) {
current.assignment_group = ritm.variables.grp_build_task;
}
// ...repeat for all 10 types
})(current, gsr);
If my response helped please mark it correct
Thanks, and Regards,
Suyash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 10:32 PM
Use a Catalog Task Business Rule on the sc_task table that:
Identifies which Catalog Task type it is (e.g., “Resource Task”, “Build Task”).
Pulls the matching assignment group variable (like grp_resource_task) from the parent RITM.
Populates the assignment_group field.
Step-by-Step Implementation
Step 1: Ensure Variables Are on RITM
Make sure that the assignment group variables (like grp_resource_task, grp_validation_task, etc.) are stored at the RITM level, not just on the Catalog Task.
In the Variable Configuration, make sure "Global = false" and "Question = true" on the main item.
These variables will then be accessible via current.request_item.variables.grp_resource_task.
Step 2: Create a Business Rule on sc_task
Table: sc_task
When: Before
Insert: True
Update: False
Condition: current.assignment_group.nil()
Script
(function executeRule(current, gsr) {
var ritm = current.request_item;
if (!ritm) return;
// Determine which task type this is (e.g., based on task name or short description)
var shortDesc = current.short_description.toLowerCase();
if (shortDesc.includes("resource")) {
current.assignment_group = ritm.variables.grp_resource_task;
} else if (shortDesc.includes("validation")) {
current.assignment_group = ritm.variables.grp_validation_task;
} else if (shortDesc.includes("build")) {
current.assignment_group = ritm.variables.grp_build_task;
}
// ...repeat for all 10 types
})(current, gsr);
If my response helped please mark it correct
Thanks, and Regards,
Suyash