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

"Assign to me" button on HR Case - agent workspace

miro2
Mega Sage

Hi

I would like to confirm that the "Assign to me" button in the HR Agent Workspace is not added by default by ServiceNow?
Or is it up to the companies and they can add it if they want. I am not sure why the button is not visible in the HR Case workspace view and the agent has to manually assign themselves, whereas it is available in the native UI.

In UX Form Actions (sys_ux_form_action) I don't see 'Assign to me' button for any HR Case table.


I know how to enable it in the UI Action (for HR Case, 'Workspace Form Button' is unchecked). What is the process behind this? Was it configured that way by design?

miro2_0-1705072253967.png

 


If anyone can shed some light on this, I would be grateful.
Thank you

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@miro2 You assumption is correct the "Assign to me" button is not added by default in HR Agent workspace. You need to follow the following steps to make this button visible and function in HR Agent workspace.

 

1. Navigate to UI Actions in the backend. Filter Assign to me button for sn_hr_core_case table.

Screenshot 2024-01-12 at 9.02.11 PM.png

2.Scroll to the bottom and check the workspace related checkboxes, and add the script in the script field.

Screenshot 2024-01-12 at 9.06.08 PM.png

Here is the script for your reference.

function onClick(g_form) {
    assignToMe();

    function assignToMe() {
        g_form.setValue("assigned_to", g_user.userID);
		g_form.submit(g_form.getActionName());
    }
}

 

Here is how the button looks on the workspace.

Screenshot 2024-01-12 at 9.08.21 PM.png

Hope this helps.

View solution in original post

13 REPLIES 13

Hi @ahefaz1 - You are correct. Unchecking "Client" does enable the script to function as expected. Thank you for the follow-up!

@Zach3 , I missed mentioning that in my first response.

Hope you are able to change your script to this shorter version.

 

Thanks,

@ahefaz1 - No worries, and yes, I was able to change the script and it is working as intended. Thanks again.

Hi @Zach3 @ahefaz1 
I apologize for the late reply. I'm glad you fixed your issue with @ahefaz1's help.