Skip to main content

Hey guys, we're running into an issue with a few of our workflows.  We're trying to use the Get Least Work method of the built in TaskAllocationRoleMethods SmartObject.  The goal is to have the task assigned to the user in the Role that has the least work assigned to them.  Unfortunately...it doesn't work!  We've got it setup and running, but for some reason it just assigns to the same person every time.  I've even ran the SmartObject directly in the  Service Tester and sure enough it always goes to the same user.  Worse still, it's NOT the user that has the least work!  The other TastAllocationRoleMethods methods (except Round Robin) do the same thing.

 

Is there an additional setting I need to set somewhere to get this working?  Do I need to do anything special with the Role, perhaps?  Are we fundamentally misunderstanding how this is supposed to work?

 

Any additional help would be great.  Thanks!

Hi Chris

 

This may not be the issue, but just be aware that adding a user to a role does not immediately update the identity cache. Normally the identity cache is set to refresh at intervals of a number of hours (e.g. every 8 hours). This means any smartobject that queries role membership will not show any new users until the identity cache is refreshed. There is a SQL script available and exe to force an identity cache update (links below), and you can run a smartobject method Get Role Users (User Role Manager Service -> URM Service ->User) to check membership of a role.

 

http://community.k2.com/t5/General-K2-Utilities/Force-Identity-Service-Refresh/ba-p/74061

http://community.k2.com/t5/K2-blackpearl/Role-Update/m-p/63200#M17687

 


Andrew,

 

Hey thanks, that's good information that our team was unaware of!  Unfortunately it doesn't appear to be the issue as running that UMUser -> Get Role Users smart object returns the expected list of users.  I'd be worried if it didn't since we set up that role and its users weeks ago.  

 

~Chris


Hi Chris, I did a quick test and it doesn't appear to work as expected for me either. I suggest you get in contact with K2 support.

 

Andrew


Thank you Andrew for your help!  I've submitted a ticket to K2.  I'll make sure to update this thread with what I hear back.


I haven't forgotten about this thread, it's just taken longer to figure things out than I originally thought it would due to company security policies getting in the way of testing.

 

It looks like we have an answer, though, and it seems to be a simple issue.  We've been testing this on our development sandbox environments, however because they are development environments we are using development licenses.  This limits us to using the K2 service in console mode.  When we start up the console, because company policy prohibits us from logging in as service accounts, we have to start it as our regular login account.  This basically means the K2 service is running under my account, not the K2 service account.  

 

We haven't had any issues with this before, but it looks like the Get Least Work functionality uses impersonation to get a task count in each users worklist queue and while the K2 service account has that impersonation rights, my account doesn't.  Because of this, when running it in console mode, K2 fails to get a proper count of how many tasks are in each users queue and thus everyone has the same value (0, I presume) and so the same person is selected each time.  

 

There are 2 ways to fix this that I know of:

1) Run the K2 console as the K2 service account.  I haven't fully tested this yet because I'm still waiting for an exception to company policy.

2) Grant yourself impersonation rights on your development environment.

 

If I find out anything else I'll update this thread again.  Hope this helps anyone else that runs into this issue!


Update:  We finally got access to the service account.  Running the K2 service console using the K2 service account (using the Run As option) works!  


Reply