Escalation to people who haven't completed task with CC to originator - single email?


Badge +9

I am trying to achieve the following:


Set up an email escalation that sends a single email to each of the people who haven't completed a task, and cc's the originator of the process so they are aware of who to chase up. (destination users and originator to receive a single email - destination users in the To field, originator in the CC field - allowing the originator to see who needs to be chased up)


If I set up the escalation at the activity level, then I can get a single email (as desired) to go to all destination users, and CC the originator. The problem with this is that it goes to all destination users, not just those that haven't completed the task.


If I set up the escalation at the event level, I end up with an email being sent to only the destination users who haven't completed the task (as desired), but the originator gets multiple copies of the email - eg if there is a task assigned to 10 people, and 2 have completed it, the originator will get 8 copies of the escalation email.


The only way that I can think of to work around this is to create a list of email addresses of destination users, and then remove the email from the list as they complete the task, however this doesn't work reliably if people redirect or delegate tasks.


Can anyone tell me how to achieve what I am trying to do?


Thanks in advance for any assistance!


PS I am using K2 BP 807 565


11 replies

Badge +5

Hi Arduk,


For the first scenario, where you set at activity level, how do you have the destinations planned?  I.e. PLAN JUST ONCE or Plan per Destination?  


Try planning per destination: all at once, and setting the escalation on activity level.  Let me know if this works for you.


Regards,


Frikkie!

Badge +9

Hi Frikkie, thanks very much for getting back to me...


My activity is already set to Plan Per Destination -> All at once


If I then set the escalation at the event level, it sends to all destination users, whether they have completed it or not. Is that not what happens for you?


Thanks again for getting back to me!

Badge +5

And if you set it on activity level does it also not work?  I don't have a VPC close-by, but when planning per destination, there will be an Activity Instance for every destination user so I think a specific activity level's escalation should fire when it has not been finished in time, thus sending an escalation mail to the destination user of that activity and the manager should work...I think.


See my previous post has a document for your reference w.r.t. planning options.  Hope this helps.


Regards,


Frikkie

Badge +9

sorry, I meant to say activity level in my previous post.


If the escalation is set at activity level and is sent to Destination users, it emails all destination users, whether they have completed the task or not.


I would love to hear that this is not what is happening to you - could indicate a bug in the version I am using or misconfiguration on my side, which would be easy to fix...

Badge +5

Sorry, as mentioned I don't have a VPC open at the moment. One more thing you may try with the "activity escalation" is to use the ActivityInstanceDestUserEmail field from the Context Browser > Activity Destination Instance > User > Email instead of using the tick box for the Destination User when setting up the escalation mail.


I'll play around with this tomorrow as well.


Let me know.


Frikkie!   

Badge +9

I believe the ActivityInstanceDestUserEmail  is only available at the event level, not at the activity level (from memory, it throws an error if used at the activity level). When I use this at the event level, I end up with multiple emails - one for each instance of the event.


Thanks very much for your persistence on this - it is very much appreciated! Hopefully it is just something I am doing wrong....

Badge +9

Hi Frikkie,


Did you ever get any further on this? I have worked around it by having 2 escalations, one at the event level and one at the activity level. Obviously, I would prefer to only have to set up one escalation, but at this stage, I feel like I have tried everything - happy to be proven incorrect though...


Anyhow, thanks for all your assistance on this!

Badge +3

Hi,


This is a lack of functionality at the moment, k2 by default send the emal to the entire destination set. You can get passed this by changing the email escalation code behind, as I also do not have a vpc near by I can not give you an example though.


Cheers


Pieter

Badge +9

Hi Pieter,


Thanks very much for confirming this for me - I wasn't sure if it was a case of me missing something, or whether this was a limitation of the product...I appreciate you taking the time to get back to me!

Badge +8

Like Pieter mentioned, custom code is required for this one, albeit a very simple change. You should be able bypass the users who have acted on the item by adding the following line:


if(oActDest.Status != ActInstDestStatus.Completed)


before the code that adds the Destination User email. More complete listing below:



// CHECK FLAG TO INCLUDE DESTINATION USER(S)


if (bool.Parse(K2.Configuration.ToDestinationUser))


{


    // IF NOT SINGLEINSTANCE


    if (!K2.ActivityInstance.SingleInstance)


    {


        foreach(ActivityInstanceDestination oActDest in K2.ActivityInstance.Destinations)


        {


            if(oActDest.Status != ActInstDestStatus.Completed)


                this.EmailMessage.To.Add(oActDest.User.Email.ToString());


        }


    }


}



 


Haven't actually tested it though, but it should work.

Badge +9

Thanks for the code sample.


I can see that this would be quite simple, howver am I correct in my understanding that if you edit the code of the a built in activity, any time you update the design templates (as I have had to do every time I have upgraded), all changes to the code are lost, and would therefore need to be re-done?

Reply