How do I get a user's Connect presence via script?

danawalsh
Kilo Contributor

So this might be a bit of a tricky one.

The whole story: I'm looking to automate new incident assignment (incidents are inbound via email and self-service) in a round-robin fashion to all members assigned to the group "Support", but only where they are currently online in ServiceNow.

I was hoping to do this by tapping into Connect somehow to obtain a person's presence. So for example:

Tech 1 - online

Tech 2 - offline

Tech 3 - online

If three new incidents are logged, my auto-assign script would assign the first incident to Tech 1, the second to Tech 3 and the third to Tech 1 again.

What I'm having trouble with is locating where in the DB that a user's presence is recorded. I've found some details around user sessions and transactions, even live profiles, but nothing that gives me a definitive flag of "online" or "true", etc.

Does anyone know how to script a function to accurately retrieve a user's current Connect presence?

Any help much appreciated!

7 REPLIES 7

Bryan Tay3
Mega Guru

hi Dan,



is the following satisfy what u need?


How to know a user is online



From your tech group, retrieve a list of tech support personnel, check their online status by querying 'v_user_session'.



hope this helps.


Hi bryantay, unfortunately not. The Logged in Users menu will only show user sessions that are sharing the same node as you. I'm looking to retrieve all online users based on group membership, regardless of node.


Dubz
Mega Sage

Hi Dan,



Did you figure out a solution to this?



We use the Queue Manager application (ServiceNow Share) this will assign tickets on a round-robin basis to members of a group. I've added a true/false box on the user form which updates their availability in the queue manager and i'm currently thinking of how best to automatically update this availability.



On-call scheduling doesn't seem to cover it but integration with an O365 (or other external) calendar could work, or possibly an integration with a Cisco phone system to make users available when they log in to their phone.



It depends on your use case but there might something you can use here. If you did manage to work out how to determine who is online based on presence i would be very interested to know how!