In this post, we will see that how to create the custom task outcome. First we will see what that is and why the task outcome is so important.
Default Task Outcome
By default, if you assign a task to someone in SharePoint 2013 workflow, the task output will look likes below.
But as per our helpdesk workflow requirement, while employee raise a ticket, the new task will be created and assigned to IT Admin user group. In this stage (Waiting for IT Admin Approval stage), he can either assign to Support Team for implement or assign back to Employee if there is any clarification and he is not going to approve or reject functionality. So our new task form output will be look like that,
We need to follow the below steps for implementing the new requirement.
- Create a new Task Outcome Column
- Create a new Content Type
- Changes in Helpdesk Workflow
- Use the Task Outcome
Step 1: Create a new Task Outcome Column
We will create a new site column RequestClarificationOrAssign with the following values
Step 2: Create a new Content Type
We will create a new site content type Request Clarification Or Assign - IT Admin View based on Workflow Task (SharePoint 2013) Content Type. And then add a site column RequestClarificaitonOrAssign with newly created content type.
Now add this content type with Helpdesk Task list and the task list content type will look like,
Step 3: Changes in Helpdesk Workflow
- Edit the Helpdesk WF workflow using SharePoint Designer 2013
- Inside the Waiting for Approval Stage, select the Assign a Task to IT Admin action
- Select the Task Properties
- Expand the Outcome Options
- Select the Task content type as Request Clarification Or Assign – IT Admin View
- So the output will look like below
Save and republish the workflow. When we create the new task, the task output screen will look like below
Step 3: Use the Task Outcome
IT Admin will click either the Request Clarification or Assign button. So we should capture the action using local variables and will use in If condition action
- Again select the Assign a Task to IT Admin action
- Select the Task Outcome
- Create the local variable ReqClarificationOrAssignOutcome
4. Now edit the If condition next to Waiting for Approval stage
5. Set the local variable ReqClarificationOrAssignOutcome like below
6. Based on the IT Admin action, the next stage will be either Request Clarification or Assign for Implementation
I hope that now we know how to create and use custom task outputcome.