The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Assigned to Auto-populating

SandeepKSingh
Kilo Sage

Hi Team,

 

When I create a HR Case the state will be draft and when I change the state to "In-Progress" the Assigned to is auto assigned. How it is happening?? 
I know for Assignemt Group we have assignment rule. Can anyone help here??

3 ACCEPTED SOLUTIONS

Bhushan216
Tera Guru

Hello Sandeep,

 

The case is assigned as per the skills definition , for example to case will be assigned as it is defined in skills like Employee Career, HR System , Hiring / policy or the HR Matching rule.

 

Please explore "hr_AssignmentAPI" Script include for exact working.

 

Please mark Correct if it helps !

 

Thanks,

Bhushan 

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh ,

 

You have to check "Maching Rule " as every COE's for a table has a Matching like the one shown below in image.

 

And they have OOB scrip include (hr_AssignmentAPI) and Under that they have utility which has the script to auto set .
Example :-

getAgentsForHrTaskBySkills: function(taskRecord) {
        //Verify recordGr is a gliderecord, and extends task
        if (!(taskRecord instanceof GlideRecord) || !taskRecord.canRead() || new GlideTableHierarchy(taskRecord.getRecordClassName()).getTables().indexOf('sn_hr_core_task') == -1)
            return [];
        var ids = this.getAgentsBySkillOrderLeastLoaded(taskRecord);
        // if the parent case is assigned, see if that person is in our list and pop them to the front if so
        if (!gs.nil(taskRecord.parent)) {
            var parentAgent = taskRecord.parent.assigned_to;
            ids = this._prioritizeAgent(parentAgent, ids);
        }
        return ids;
    },

 


RaviGaurav_0-1724831306373.png

 

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@SandeepKSingh There are following possibilities in this case.

1. Business rule: Please check if there is any business rule which is triggering when the state changes to in-progress.

2. Assignment rule is out of equation if the Assignment group is already populated

3. Please check if there is any flow/workflow attached with your HR Case which auto assign the ticket to an individual

4. Matching rules is also one possibility which specifically checks if the Assignment group is not empty and assigned to is empty.

 

Here is an example.

 

Screenshot 2024-08-28 at 1.27.56 PM.pngScreenshot 2024-08-28 at 1.28.01 PM.png

Hope this helps.

View solution in original post

5 REPLIES 5

sejal1107
Tera Guru

1. Assignment Rule- Based on the applies to conditions (if condition matches) Assignment group(group) or assigned to(user) can be set

May be in your case condition is set as( HR Case state is In Progress) and user is set as your auto assigned user thats why when conditions satisfies Assigned to is auto assigned.

Screenshot 2024-08-28 at 12.47.04 PM.png

 

2. Matching Rules-  used for case routing. They identify cases that meet specific conditions and then route them to the appropriate agents.

  • Criteria: Matching rules focus on matching specific attributes of the case (e.g., keywords, category, or location) to predefined conditions.

 

 

 

Please check and Mark Helpful and Correct if it really helped you.
Thanks & Regards
Sejal Chavan

Bhushan216
Tera Guru

Hello Sandeep,

 

The case is assigned as per the skills definition , for example to case will be assigned as it is defined in skills like Employee Career, HR System , Hiring / policy or the HR Matching rule.

 

Please explore "hr_AssignmentAPI" Script include for exact working.

 

Please mark Correct if it helps !

 

Thanks,

Bhushan 

Najmuddin Mohd
Mega Sage

HI @SandeepKSingh ,

Can you check that the Assignment group is having only one user

or,

I would tell you to navigate to All > System Diagnostics > Script Tracer and Click Start Tracer.
Now, navigate to HR case and change the state to Assigned to.

You will be getting all the records the are running in the background and you will knowing which record was used to populate Assigned to.

It may Assignment rules, or Business rules or anything. Script tracer will help you.

If this information helps you, Kindly mark it as Helpful.

Regards,
Najmuddin.

Ravi Gaurav
Giga Sage
Giga Sage

Hi @SandeepKSingh ,

 

You have to check "Maching Rule " as every COE's for a table has a Matching like the one shown below in image.

 

And they have OOB scrip include (hr_AssignmentAPI) and Under that they have utility which has the script to auto set .
Example :-

getAgentsForHrTaskBySkills: function(taskRecord) {
        //Verify recordGr is a gliderecord, and extends task
        if (!(taskRecord instanceof GlideRecord) || !taskRecord.canRead() || new GlideTableHierarchy(taskRecord.getRecordClassName()).getTables().indexOf('sn_hr_core_task') == -1)
            return [];
        var ids = this.getAgentsBySkillOrderLeastLoaded(taskRecord);
        // if the parent case is assigned, see if that person is in our list and pop them to the front if so
        if (!gs.nil(taskRecord.parent)) {
            var parentAgent = taskRecord.parent.assigned_to;
            ids = this._prioritizeAgent(parentAgent, ids);
        }
        return ids;
    },

 


RaviGaurav_0-1724831306373.png

 

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/