The CreatorCon Call for Content is officially open! Get started here.

Josh Sutton
ServiceNow Employee
ServiceNow Employee

DISCLAIMER: This article describes a proposed solution to support this use case. 

The proposed solution requires configuration, as such, there is no liability for ServiceNow to provide support, apply changes, fix defects and review impact during future upgrades.

 

What problem does this solve?:

Being able to provide consistent Resource Assignments within Project Templates allows organizations to efficiently provide starting points for Projects that require the same role, group, or skill at certain points of a project plan or for specific types of projects.

This guide will walk you through configuring the platform to allow adding Resource Assignments to your Project Templates.

 

**UPDATE for Resource Management Workspace v5.2 (Aug '25 release)

A new check was put in place to validate a Resource Assignment by validating the 'resource_status' field was 'not null', this field needs to be added as part of the Project Template Configuration for Project and Project Task.

**For any existing Project Templates that do not contain this attribute, manually adding this configuration to your Templates is recommended. Please see additional instructions for this at the bottom of the article.

  • Configure Project Template elements for Resource Assignments (included in update set)
    This allows for Project Templates to capture Resource Assignments when saving as a Template
    1. Go to Project Administration > Settings > Template Config
    2. Add two (2) new configurations
      1. For Project
        • Table: Resource assignment [sn_plng_att_core_resource_assignment]
        • Parent Table: Project [pm_project]
        • Link element: Task
        • Active = true
        • Elements: assignment_type, distribution, effort_type, effort, *resource_status, group_resource, role, skill
          It is strongly recommended to minimize any additional elements, as we need to ensure creation of the Resource Assignments populate and work appropriately.
        • The name column (element) could be added if that is applicable and appropriate for your organization.
        • Test any additional elements THOROUGHLY!
          Project_Template_Configuration___ServiceNow.jpg

      2. For Project task
        • Table: Resource assignment [sn_plng_att_core_resource_assignment]
        • Parent Table: Project Task [pm_project_task]
        • Link element: Task
        • Active = true
        • Elements: assignment_type, distribution, effort_type, effort, *resource_status, group_resource, role, skill
          It is strongly recommended to minimize any additional elements, as we need to ensure creation of the Resource Assignments populate and work appropriately.
        • The name column (element) could be added if that is applicable and appropriate for your organization.
        • Test any additional elements THOROUGHLY!
          Project_Template_Configuration___ServiceNow task.jpg

  • Create an Extension Point Script Include (included in update set)
    This allows for the business rules to fire for updating the Resource Assignments once applied via the Template
    1. Navigate to System Extension Points > Scripted Extension Points
      • Open ‘global.ProjectTemplate’
    2. Once on the record, click ‘Create implementation’ Related Link
      • Name: ProjectTemplateResourceAssignments
      • Description: Implements extension point global.ProjectTemplateResourceAssginment for running applicable rules on creation of Resource Assignments within Project Templates when applied to a Project.
      • Insert in the script, within the function, the following code:
        //Get associated planning item
        var project = new GlideRecord('sn_align_core_project');
        project.addQuery('execution_entity_item', projectId);
        project.query();
        if (project.next())
        var planningItemId = project.getValue('sys_id');
        //Get associated resource assignments
        var g = new GlideRecord('sn_plng_att_core_resource_assignment'),
        objAr = [];
        g.addEncodedQuery('sys_idIN' + JSON.parse(listOfTaskIds));
        g.query();
        //construct object with previous effort + update effort to 0
        while (g.next()) {
        objAr.push({
        'id': g.getUniqueValue(),
        'effort': g.getValue('effort')
        });
        g.effort = 0;
        g.update();
        }
        this.updatePlanningItemFieldOnResourcePlanEntities(projectId, planningItemId);
        //loop through previously constructed array of object(s) and update with actual effort
        if (objAr.length > 1) {
        for (var i in objAr) {
        g.initialize();
        if (g.get(objAr[i].id)) {
        g.effort = objAr[i].effort;
        g.update();
        }
        }
        }
        },
        //bulk updating planning items on Resource Assignments
        
        updatePlanningItemFieldOnResourcePlanEntities: function(task, planningItem) {
        this._updatePlanningItemFieldforTopTask('sn_plng_att_core_resource_assignment', task, planningItem);
        this._updatePlanningItemFieldforTopTask('resource_plan', task, planningItem, 'resource_type=attribute');
        this._updatePlanningItemFieldforTask('resource_allocation', task, planningItem, 'resource_plan.resource_type=attribute');
        this._updatePlanningItemFieldforTask('sn_plng_att_core_cpaam_effort', task, planningItem);
        },
        _updatePlanningItemFieldforTask: function(table, task, planningItem, encodedQuery) {
        var gr = new GlideRecord(table);
        gr.addQuery('task', task);
        if (!gs.nil(encodedQuery))
        gr.addEncodedQuery(encodedQuery);
        gr.setValue('planning_item', planningItem);
        gr.setWorkflow(false);
        gr.updateMultiple();
        },
        _updatePlanningItemFieldforTopTask: function(table, task, planningItem, encodedQuery) {
        var gr = new GlideRecord(table);
        gr.addQuery('top_task', task);
        if (!gs.nil(encodedQuery))
        gr.addEncodedQuery(encodedQuery);
        gr.setValue('planning_item', planningItem);
        gr.setWorkflow(false);
        gr.updateMultiple();

         

        ProjectTemplateResourceAssignments___Script_Include___ServiceNow.jpg

    3. Save Script Include
    4. Navigate back to the Extension Point and find the newly created implementation on the Related List.
      This allows for all other Template related Script Includes to run BEFORE the newly added one.
      • Add the ‘Order’ column to the list
      • Update the new ‘ProjectTemplateResourceAssignments’ order to “1000”.
  • Create a Project Template that includes Resource Assignments
    1. Create a new Project in Project Workspace (or use an existing one)
    2. OPTIONAL: Apply an existing Project Template
    3. OPTIONAL: Create new tasks if not applying an existing Project Template
    4. Create ‘Unassigned’ Resource Assignments on the Project Summary Task OR on the applicable Project Tasks
      • Make sure you fill in the Effort type, Effort, and applicable attribute(s) – Group, Role, and/or Skill for each Resource Assignment.
    5. Save the newly created Plan w/ Resource Assignments to a new Project Template

  • Apply the newly created Project Template to a Project
    1. Follow your approved process for applying templates to projects.

  • Configure additional setting - Expose Resource Assignments on Project Tasks
    1. To see Resource Assignments on Project Tasks, the Related List must be added.
      • While on Project Task record (in native UI form), Configure > Related Lists
      • Add the Resource Assignment -> Task to Selected and Save
         Project_task_Related_List 1.jpg

         

        Project_task_Related_List 2.jpg

         

      • This will be on the Form as well as appear within Project Workspace now

        Project_task_Related_List 3.jpg

         

        Project_task_Related_List 4.jpg

         

  • To accommodate the change in RMW v5.2, any existing Project Template with Resource Assignments needs to be updated to include the 'resource_status' data as follows:
    1. Navigate to Project Administration > Templates - Project and select the Project Template containing Resource Assignments
    2. Under the Project Template Tasks related list, sort by Table = Resource assignment [sn_plng_att_core_resource_assignment]
    3. Go into each record, in the Data section and add 'Resource status' = Unassigned


      Project_Template_Task___ServiceNow.jpg
Comments
Josh Sutton
ServiceNow Employee
ServiceNow Employee

**UPDATE for Resource Management Workspace v5.2 (Aug '25 release)
A new check was put in place to validate a Resource Assignment by validating the 'resource_status' field was 'not null', this field needs to be added as part of the Project Template Configuration for Project and Project Task.
Updates have been added to the document.

Version history
Last update:
3 weeks ago
Updated by:
Contributors