Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Disable the agent ability to change the their status state in Advance Work Assignment (AWA)

trangdan106
Tera Contributor

Hello everyone,

I have this requirement where I was to make it that the agent shouldn't have the ability to change their state:

trangdan106_0-1776999512649.png

Currently, I have resorted to using a BR where if the agent interact with the UI, the user has the agent role and they are part of a specific group then if the agent changes their state, the state will be change the status back.

 

But is there a more efficient way to do it?

Thank you you all in advance.

3 REPLIES 3

Tanushree Maiti
Kilo Patron

Hi @trangdan106 

 

1)Using a BR is an efficient method to update awa_agent_presence when specific conditions are met.

Refer:  Advanced Work Assignment: (Un)Set Agent's Availability automatically

 

2) Can I automatically set the presence of agents to unavailable?
Yes – you can set the timeout for agent presence using the system property com.glide.awa.agent_inactivity_threshold_seconds. You may have to create it within your instance, with the value set to the number of seconds before the agent is marked as inactive.

 

Refer: Advanced Work Assignment (AWA) FAQs

 

 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

Not quite what I had in mind, I will be using the BR method to check whether a user part of said group performed any actions on the UI that involves the AWA state.

 

However, I thank you for your supports, those links helped.

vaishali231
Kilo Sage

Hey @trangdan106 

A better approach is to prevent the update at the source instead of correcting it afterward.

1. Use ACL on Presence Table

Agent availability/status is stored in the sys_user_presence table.

You can create a Write ACL on this table (or specifically on the state field):

 Script:

// Deny agents in specific group from changing state

if (gs.hasRole('sn_omnichannel_agent') && gs.getUser().isMemberOf('YOUR_GROUP_NAME')) {

   answer = false;

} else {

   answer = true;

}

 This ensures:

  • The change is blocked before it happens
  • No need for rollback logic
  • Better performance and cleaner design

 

2. Hide the UI Control in Workspace (Optional)

Since this is in Service Operations Workspace, you can also improve UX by hiding the presence toggle:

  1. Go to UI Builder
  2. Locate the Agent Presence component
  3. Apply conditional visibility based on role/group

This avoids confusion for agents since they won’t even see the option.

 

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

If this response helps, please mark it as Accept as Solution and Helpful.

Doing so helps others in the community and encourages me to keep contributing.

Regards

Vaishali Singh

Servicenow Developer
Linkedin - https://www.linkedin.com/in/vaishali-singh-2273361bb