
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 06:58 AM
I want to change the Agent's status to available automatically in inbox of agent workspace instead of manually changing it.
By default it's offline.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 07:17 AM
When logging in a corresponding event is fired:
That event can be caught by a so-called script action (you have to implement this!), which would set the status of the user in case the user is also registered as agent.
The following Script Action works as expected:
And the code from the Script field for copying purpose:
var grUser = new GlideRecord("sys_user");
grUser.addQuery("user_name", event.parm1.toString());
grUser.query();
if (grUser.next()) {
var grAgent = new GlideRecord("awa_agent_presence");
if (grAgent.get('agent', grUser.getUniqueValue())) {
//Set Sys ID of Status 'Available'
grAgent.setValue('current_presence_state','0b10223c57a313005baaaa65ef94f970');
grAgent.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2021 07:17 AM
When logging in a corresponding event is fired:
That event can be caught by a so-called script action (you have to implement this!), which would set the status of the user in case the user is also registered as agent.
The following Script Action works as expected:
And the code from the Script field for copying purpose:
var grUser = new GlideRecord("sys_user");
grUser.addQuery("user_name", event.parm1.toString());
grUser.query();
if (grUser.next()) {
var grAgent = new GlideRecord("awa_agent_presence");
if (grAgent.get('agent', grUser.getUniqueValue())) {
//Set Sys ID of Status 'Available'
grAgent.setValue('current_presence_state','0b10223c57a313005baaaa65ef94f970');
grAgent.update();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2021 08:35 PM
Hi
Did my reply answer your question?
If so, 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.
If not, please tell me what is still missing.
Kind regards
Maik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2021 04:41 AM
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2021 10:13 PM