How to make Agent's status Available automatically in inbox of agent workspace once user is signed in ?

Community Alums
Not applicable

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.

find_real_file.png

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

When logging in a corresponding event is fired:

find_real_file.png

 

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:

find_real_file.png

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();
	}
}

View solution in original post

10 REPLIES 10

Maik Skoddow
Tera Patron
Tera Patron

When logging in a corresponding event is fired:

find_real_file.png

 

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:

find_real_file.png

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();
	}
}

Hi @Kanhaiya 

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

Community Alums
Not applicable

Thanks @Maik Skoddow , It's working for me

Hi Maik,

I followed the same, it is not working for me, please advise what am I missing here,

while creating a new event which table name should I select, is this 

find_real_file.png

Please help here as I am looking for this.