- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 12:16 PM
When an Agent clicks the workspace application link, I want to automatically set their availability to Available so the agents do not have to set this themselves. Anyone have any ideas if this possible?
Solved! Go to Solution.
- Labels:
-
Agent Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 08:54 PM
Hi
each time a user logs in an event is fired. With the help of a script action you can react on that event and set the availability.
And for an easy copy and paste of the code:
var gr = new GlideRecord("awa_agent_presence");
gr.addQuery("agent", event.user_id.toString());
gr.query();
if (gr.next()) {
gr.setDisplayValue("current_presence_state", "Available");
gr.update();
}
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 12:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-12-2021 08:54 PM
Hi
each time a user logs in an event is fired. With the help of a script action you can react on that event and set the availability.
And for an easy copy and paste of the code:
var gr = new GlideRecord("awa_agent_presence");
gr.addQuery("agent", event.user_id.toString());
gr.query();
if (gr.next()) {
gr.setDisplayValue("current_presence_state", "Available");
gr.update();
}
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2021 08:13 AM
Is there an event fired when a user clicks the agent workspace home menu button? I want them to become available when they get to the URL and not when they log into servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-13-2021 10:07 AM
Also your code throws this SetDisplay error in Logs
com.glide.script.fencing.MethodNotAllowedException: Function setDisplayValue is not allowed in scope x_g_irmc_dos_agent Caused by error in <refname> at line 1 ==> 1: var gr = new GlideRecord("awa_agent_presence"); 2: gs.info("testing this is working in Set Agent Online"); 3: gr.addQuery("agent", event.user_id.toString()); 4: gr.query(); |