Thank you for the direction on this. I'm not really at the point of being able to write web services to accomplish this and was hoping there was a way to write a workflow to query the smartobject and then write it all out to a table. I can do this in MS Flow with my own tasks but wanted to make it possible to set this up for everyone.
Did you ever find a method for this??? I have the same requirement and want to go down a good starting point for investigation.
Hi, you can try create Stored Procedure,
WITH cte AS (
SELECT ps.[DisplayName] AS [ProcessName],pi.Folio,a.DisplayName AS [ActivityName],pi.Originator, aid.[User] AS [AssignedTo], wlh.[Data] AS [Task URL] --,wlh.InstructionField, pi.DelegatedBy --,aid.* --
FROM [K2DB].[Server].[WorklistHeader] wlh
JOIN [K2DB].[Server].[WorklistSlot] wls ON wls.ActInstID = wlh.ActInstID AND wls.EventInstID = wlh.EventInstID AND wls.ProcInstID = wlh.ProcInstID and wls.Status != 4
JOIN [K2].[Server].[ProcInst] pi WITH (NOLOCK) ON pi.ID = wlh.ProcInstID
JOIN [K2].[Server].[Proc] p WITH (NOLOCK) ON p.ID = pi.ProcID
JOIN [K2].[Server].[ProcSet] ps WITH (NOLOCK) ON ps.ID = p.ProcSetID
JOIN [K2].[Server].[Act] a WITH (NOLOCK) ON a.ID = wlh.ActID
JOIN [K2].[ServerLog].[ActInstDest] aid WITH (NOLOCK) ON aid.ID = wlh.ActInstDestID AND aid.ProcInstID = wlh.ProcInstID AND aid.ActInstID = wlh.ActInstID
WHERE aid.[User] = 'K2:domainusername'
)
SELECT * FROM cte
--
then send this task list to the user