Hi everyone,
I need to build a trigger when the case is reopened (because the customer replied to an email back), but I have to check if the owner who closed it has been offline for more than 30 minutes. If yes, I have to reassign the case owner to the queue, if not I will just reopen the case.
Can I do this via flow? I tried using the UserServicePresence object but I'm struggling to get the "Offline" Presence status.
7 answers
@Renato Mattos I think you can get this data from a flow. In your Get Record element, search for UserServicePresence records having:
- UserId = case owner
Then sort them by StatusEndDate (descending) and take the first record. Check its values:
- If this record has IsCurrentState = true and IsAway = false, it means the user is currently online, there's no need to change the owner
- If this record has IsCurrentState = false, it means the user is currently offline:
- if the StatusEndDate was less than 30 minutes ago, there's no need to change the owner
- if the StatusEndDate was more than 30 minutes ago, the owner needs to be changed