I have 2 criteria I'd like to send a Reminder email for but I'm struggling getting the data from the objects I have access to.
Our current process is simple. An application is submitted and goes into a "Review" queue that is assigned to a Group. If no one claims the task within 2 days I need to send a Reminder to the entire Group. IF someone has claimed the task but hasn't processed it after 2 days then I'd like to send a Reminder email to the person that claimed the task.
I'm inspecting the Txn and Job vos but can't see the User who claimed the task. I also don't know a way of sending an email to the entire group for unclaimed tasks. Any pointers? Lastly, how can you determine an unclaimed task vs a claimed task?
def txn = txnQuery.setTrackingCode(<Code>).withAll().firstValue()
When a Txn is put into a Queue, it is assigned to a group, not to anyone.
So you just check "txn.timeCreated" to make sure it is 2 days from today, then check "txn.groupNames" to make sure it is in the right group, and "txn.userLoginName" to make sure it hasn't been assigned to anyone, ie null. Then send out reminder email to people to look at.
If Txn has been assigned to someone, then look for "txn.timeUserLastModified", make sure that is 2 days from today, then send email to that person.