Hi All,
I am developing a SharePoint Add-In on SharePoint Online.
Background: Business requirements is that approvers should be able to perform bulk approval on the OOTB SharePoint Online Workflow Task list. I have developed a custom action called as Bulk approval where approvers can Approve or Reject leave
request as shown below:
In the custom code, I have code the status to be Completed and Outcome to Approved if the Approves clicks on Approved button on bulk approval custom action using CSOM with following code:
var item = item[0];
Item.set_item(“Status”, “Completed”);
item.set_item(“Outcome”, “Approved”);
item.update();
Challenge:
Workflow Tasks has references to all the document libraries and custom list where workflow is attached. I have challenge to get all the document libraries, custom lists and loop the each document library, custom list and set the Workflow
status to Status, outcome depends on user action. There is related item
column in the Workflow task as shown:
I made research and found some links:
CSOM: http://sharepoint.stackexchange.com/questions/88327/get-related-item-id-from-a-workflow-task-list
REST: https://social.msdn.microsoft.com/Forums/office/en-US/820300e1-ed15-49ee-8ef7-775e6d929d9d/how-to-get-workflow-task-list-id?forum=sharepointcustomizationREST:
http://sharepoint.stackexchange.com/questions/116938/sharepoint-online-2013-retrieving-a-task-by-its-related-list-item
The links are quite useful but not exactly what I need to achieve this.
Any code sample would be highly appreciated.
Thanks.
Sandy