Assign an approval task in a workflow
Summary: Learn how to add an approval task to a Project Web App workflow.
Applies to: Project Server Subscription Edition, Project Server 2019, Project Server 2016, Project Server 2013
By including an approval task in your Project Web App workflow, you can ensure that your projects receive proper approval before they get underway. In this article, we'll look at an example of using an approval task in a workflow to allow selected users to approve or reject a project.
Before you begin
Before starting, make sure:
If you are using an on-premises deployment of Project Server, you have set up the SharePoint 2013 workflow platform.
You have created the sample workflow, stages, and enterprise project type as described in Create a sample Project Web App workflow.
Create a workflow with an approval task
We'll be using the Sample Workflow that you created in Create a sample Project Web App workflow to build a workflow that looks like this:
If you've completed the procedures in other articles in this series, you may already have part of this workflow in place. The complete steps for creating this workflow are in the following procedure.
To create a workflow
Start SharePoint Designer.
Connect to your Project Web App site.
On the left, click Workflows.
Click Sample Workflow.
Click Edit workflow.
On the ribbon, click Stage, and then click 1 - Propose idea.
Place the orange cursor in the top section of Stage 1 and, on the ribbon, click Action, and then, under Project Web App Actions, click Wait for Project Event.
Click this project event, and choose Event: When a project is submitted from the dropdown menu.
Place the orange cursor below Stage 1, click Stage, and then click 2 - Request idea.
Place the orange cursor below Stage 2, click Stage, and then click 3 - Execute.
Place the orange cursor below Stage 3, click Stage, and then click 4 - Cancelled.
Place the orange cursor in the Transition to stage area of Stage 1, and then, on the ribbon, click Action, and then click Go to a stage.
Click the a stage link, and then choose 2 - Request review from the dropdown list.
Place the orange cursor in the top half of Stage 2.
On the ribbon, click Action, and then, under Task Actions, click Start a task process.
Click the these users link.
On the Start a Task Process page:
Click the ellipsis ( ...) for Participants and add the name of the user to whom you want to assign the project approval task.
For Task Title, click fx, choose a Data source of Project Data, a Field from source of Project Name, and click OK.
Click OK.
Place the orange cursor in the Transition to stage section of Stage 2.
Click Condition and select If any value equals value.
Click the first value link, and then click fx.
Choose a Data source of Workflow Variables and Parameters and a Field from source of Variable: Outcome and click OK.
Click the second value link and choose Approved from the dropdown list.
Place the orange cursor in the If branch of the If / Else statement.
On the ribbon, click Action, and then choose Go to a stage.
Click the a stage link, and then choose 3 - Execute.
Place the orange cursor in the Else branch of the If / Else statement.
On the ribbon, click Action, and then choose Go to a stage.
Click a stage, and then choose 4 - Cancelled from the dropdown menu.
Place the orange cursor in the Transition to stage area of Stage 3, and then, on the ribbon, click Action, and then click Go to a stage.
Click a stage, and then choose End of Workflow from the dropdown menu.
Place the orange cursor in the Transition to stage area of Stage 4, and then, on the ribbon, click Action, and then click Go to a stage.
Click a stage, and then choose End of Workflow from the dropdown menu.
On the ribbon, click Publish.
Test it out
With the workflow published, we can create a sample project to see how the approval task works.
To create a project
In Project Web App, in the left navigation, click Projects.
On the ribbon, click the Projects tab.
Click New, and then click Sample Project Type.
Name the project Assign an approval task, and then click Save.
On the Workflow Status page, click Submit, and then click OK to confirm.
Once the project has been created and submitted, you'll notice that the Current Workflow Stage is 1 - Propose idea. The workflow will pause here until the user to whom you assigned the approval task approves or rejects the project.
Let's take a look at what happens when the user approves the task.
To approve a task
Log into Project Web App as the user to whom you assigned the task.
In Project Web App, in the left navigation, click Approvals.
On the ribbon, click Workflow Approvals.
On the Workflow Tasks list, click All Tasks.
Click Assign an approval task.
On the ribbon, click Edit.
Click Approved.
Notice that once the task has been approved, the Current Workflow Stage is 3 - Execute. Try creating another project, and this time choose Rejected for the approval task. Note that the Current Workflow Stage is 4 - Cancelled.
In the next article, we'll look at how to add an additional approval option to the approval task.
See also
Create a sample Project Web App workflow
Have a workflow wait for a Project Web App event
Set the stage status in a Project Web App workflow