
Objective
To create a project in Project Server 2013 by initiating a workflow from a SharePoint list item. A user who initiates the workflow may not necessarily have the Project Server 2013 permission to create a project in PWA.
Feature Highlight
Use the SharePoint Designer 2013 “AppStep” feature to resolve the hurdle of the workflow initiator having insufficient permissions to create a project in the Project Web App instance.
Notes
The SharePoint farm is configured for multi-tenancy.
A lot of the necessary steps are detailed in the following blog https://msdn.microsoft.com/en-us/library/jj822159.aspx
For further detail on assigning the require permissions to the workflow app please see https://msdn.microsoft.com/en-us/library/office/fp142383.aspx
High Level Prerequisites
- An AppCatalog must be provisioned.
- The Workflow app must be assigned the necessary permission.
- The “SharePoint App” user must be granted sufficient permission in project server web app instance.
- The SharePoint Designer 2013 workflow needs to contain the ‘Create Project from SharePoint List Item” action with an AppStep.
Step By Step
- Provision an AppCatalog if not done so already.
In a multi-tenancy environment, this should be done by navigating to the tenant Administration site >> Manage App Catalog >> Create a new app catalog site.
I named the site collection “AppCatalog”.
- Activate the Site feature “Workflows can use app permissions”. Please note that this is not a site collection feature but a site feature.
- Grant the SharePoint full control permission and the Project Server manage permission to a workflow.
- Click the Settings (gear) icon.
- Select “Site Settings” from the context menu
- Click on “site app permissions”
- Copy the client section of the App Identifier. This is the identifier between the last “|” and the “@” sign, as shown in the screenshot below.
- Navigate to the Grant permission to an app page. This must be done by browsing to the appinv.aspx page of the site. E.g.
https://tenanthostname/sites/appcatalog/_layouts/15/appinv.aspx
- Paste the client id in the App Id field and then click Lookup, as shown in the figure.
- Paste the following Permissions Request XML to grant Full Control (SharePoint) permission and Manage (Project Server) permission. Paste the contents below exactly as is.<AppPermissionRequests>
<AppPermissionRequest Scope=”http://sharepoint/content/tenant” Right=”FullControl” />
<AppPermissionRequest Scope=”http://sharepoint/projectserver” Right=”Manage” />
</AppPermissionRequests>
- Click on the “Create” button.
- You will then be asked to trust the Workflow app, as shown in the screenshot below. Click Trust It.
- Create a new custom list in your Project Web App (PWA) site. In my example, I have a list called “AppStep Test”
- Open PWA in SharePoint Designer 2013
- Click Workflows in the navigation window
- Create a new list workflow on the custom list just created (e.g. AppStep Test).
I labelled my new workflow “CreateProjectUsingAppStep”. - Click on the App Step icon on the toolbar.
Before App Step is inserted
After App Step is inserted
- Chose the action “Create Project from Current Item” and insert it within the App Step section. This will cause the project to be created under the credentials used by the Workflow App, which earlier we gave Full Control of the tenant site collection and Manage permissions of Project Web app (which allows for a project to be created).
- Once your workflow is complete, publish your completed workflow.
- At this stage, I was expecting the ability to create a project by logging as a user with Team Member permissions, creating an item on my AppStep Test list and finally running the workflow on the new item. However, the workflow failed and was stuck in a suspended state.
Another step was required!! - After the first failed attempt to create a project, I added a new user with the following id “i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint”. This is done by navigating to PWA Settings >> Manage Users >> Click on New User button. I added this user to the Administrators PWA security group.
- Now I can successfully create a project by creating a new item on my AppStep Test list and running the workflow created in this blog. The credentials used only have Team Member permissions. The screenshot below shows my new project appearing in Project Center.
Great post! Step 12, where you added the “i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint” account to PWA resolved our last work workflow issue. Thanks a ton!
-Eugene
Hi, I’ve followed the steps above, but when the workflows tries to create the project I get the following error:
PJClientCallableException: GeneralNotLicensed
GeneralNotLicensed
method = CSOM.CreateProjectFromListItem
user = i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint
Has this happened to you? Any help would be appreciated.
Hi AndyG,
The issue you’re facing is due to Project Online (as opposed to SharePoint 2013 On-Premise) demanding an Office 365 licence for the account i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint. As it is not possible to assign the “internal” account an Office 365 licence, it means that at this time, Project Online does not support the functionality in this blog.