hi
i want to allocate a workitem based on shortest queue when i click on a button .
can anybody help me?

You can choose shortest queue as the allocation strategy in the resourcing section of the task:

 

Could you explain what you mean by "clicking a button"?

i developing a custom service and i want to use shortest queue allocation strategy so i have a button and when i clicking it workitem allocated based shortest queue allocation strategy.