I have a SharePoint 2013, Visual Studio workflow running with one task started. I want to access the tasks collection of the list item that the workflow is associated with.
When I access the tasks via the code shown below, Im getting a null value. The Tasks collection count for that list item says it's 0. But I do have a task created.
taskToEdit = listItem.Tasks[0];
How can I access the tasks collection? I want to approve / reject these tasks via code from outside the workflow.
please help!