REST API - Out of Office Tasks


We are using the workflow REST API to list, open/assign, and action workflow tasks through a custom web app. We have discovered that tasks assigned to a different user through out of office forwarding do NOT show up in the list of tasks. Additionally, you cannot open/allocate or action these tasks through the API endpoints either. Has anyone else run in to this, or possibly found a solution for handling OOF tasks through the API?

 

If I recall correctly, this functionality was available through the on-prem api endpoints, through passing a "shareduser" parameter.

 

Thanks in advance!


7 replies

You can call the Rest API smart object to get the details. 

 

Smart object is - com_K2_System_Workflow_SmartObject_WorklistItem

 

If you are using k2 forms then there is no need to call API and all just go and call the smo direct on form and get the task.

 

you can find the smart object here.

 

Categories -> System -> Management ->  Workflows -> (Worklist Item)

 

Hi  @ProInception ,

 

Thanks for the response. I'm glad to know about that SmartObject because it does give me the list of items, including OOF tasks, but that appears to be the only method it contains. I'm also looking for a way to open, assign, and action those OOF tasks through the REST API.

 

Calling the task endpoint with the SN provided in that SmartObject result still results in 'access denied'.
/Api/Workflow/Preview/tasks/:serialNumber


Thanks again!

you need to write rules on form and you can do everything by using it . There you can find serial number as well.


@dknudsen wrote:

Hi  @ProInception ,

 

Thanks for the response. I'm glad to know about that SmartObject because it does give me the list of items, including OOF tasks, but that appears to be the only method it contains. I'm also looking for a way to open, assign, and action those OOF tasks through the REST API.

 

Calling the task endpoint with the SN provided in that SmartObject result still results in 'access denied'.
/Api/Workflow/Preview/tasks/:serialNumber


Thanks again!


 

Sorry, I forgot to clarify that this is not a K2 Smart Form. We have written our own UI (.Net), and we interact with K2 through the REST API only.

 


@ProInception wrote:

you need to write rules on form and you can do everything by using it . There you can find serial number as well.




OK then its ok you need to construct your worklist URL and pass the serial No SN value and then get it into worklist that's it.

 

are you facing any isuse?

Yes, the issue is that when I have a task assigned to me, due to Out of Office Forwarding, the REST API returns:

{
  "Message""Task could not be retrieved. Either access denied or not found."
}
I used the SmO you suggested earlier, and see the item in the result set with SerialNumber 809_56. The AllocatedUser is not my username, because of the OOF. Sending the request to https://*****.onk2.com/api/workflow/v1/tasks/809_56
 
Tasks that are assigned to me in the traditional manner, have no issues. Only OOF, as it seems to be missing the SharedUser parameter, or something. Even the K2 worklist passes in a "&SharedUser=" parameter, when you watch what it is doing.
There's a submission on the idea forum for this, could use some more up votes:
https://ideas.k2.com/ideas/APIT-I-1250

Reply