Reassign workflow task using the workflow web service – AlterToDo method

SharePoint provides a web service workflow.asmx. This is available under /_vti_bin/workflow.asmx and provides an operation AlterToDo which enables to update the task and also reassign the tasks.

I recently had a customer who was having issues with the AlterToDo. Customer was calling the AlterToDo method of the workflow.asmx as per the documentation available but the task was not getting reassigned.

On researching further we could see that there is no accurate documentation on the internet for using the AlterToDo method to reassign tasks.

Following is the code sample which calls the AlterToDo method.

               string strURL = "http://sp/documents/doc1.docx";

            // task item id
            int intToDo = 1;

            // Task list id
            Guid GUIDToDoListID = new Guid("{f46aa19e-ea35-4357-80f4-882306a2ebdc}");

             WorkflowService.Workflow client = new WorkflowService.Workflow();

            client.Credentials = CredentialCache.DefaultCredentials;

            string strData = "" ; /*Some xml comes here */

            XmlDocument XMLTaskData = new XmlDocument();


            var data3 = client.AlterToDo(strURL, intToDo, GUIDToDoListID, XMLTaskData);


By accurate documentation I am referring to the xml sent to AlterToDo method.

Following is the correct xml to reassign a task.

var strData = @"<my:myFields xmlns:my=''>
                            <pc:Person xmlns:pc="""">
                            <pc:DisplayName>User 2</pc:DisplayName>

I haven't seen this method being used very widely. But when it is being used it can be a bummer to get this working without the correct xml to reassign tasks.

Thanks to my Escalation Engineer Andy Li for helping in figuring this out.


Skip to main content