I'm developing Sharepoint 2013 Workflow in Visual Studio and I need to get ID of a task that is created by Single Task activity and write it to list item's field. What's the best way to achive this?
I know this is a bit late answer but it will definitely save others' time. If you want to get the task id to send on email notification (for instance) before the task is ended, best approach I found is in this article: customize task approval email to include link to respective task
I tried it myself and working like a charm
There is some documentation, basically since Sharepoint is not syncronous you need to commit changes or add pauses to give it time. That way you can make sure the value is available when you need it
Hope you can find this useful