Project Online: Adding tasks where you want them with Power Automate

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

This is a guest post from Daniel Partridge - who answered an internal enquiry at Microsoft, for a colleague who needed to add a task under a summary using Power Automate (Flow).  Great timing as Daniel was also looking at the same challenge.

In Daniel's words and pictures:

 

In order to accomplish this, I used the “Send and HTTP Request to SharePoint” action in my Power Automate flow, and the end result appears in the schedule as shown in this image:

 

screenshot of the first 3 tasks in a plan - showing the end result of this code - adding a task under the summary

The flow process would be as follows (*IMPORTANT: The REST API to use for this would be ProjectServer vs. ProjectData in the URL).  ProjectData is used for reporting - OData.

 

  • Get the Project Id (GUID)
  • Get the Id (GUID) of the Summary task
  • Checkout Project - Power Automate Project Online Action
  • Send HTTP Request to SharePoint - Power Automate SharePoint Action

HTTP POST: _api/ /Draft/Update()/Projects('ProjectGUID')/Draft/Tasks/Add()

 

Header JSON

{

  "Accept": "application/json;odata=nometadata",

  "Content-Type": "application/json"

}

 

Body JSON

{

   "parameters":

   {

      "Name": "task title",

      "Notes": "task notes",

      "Duration": "2d",

      "ParentId": "summaryTaskGUID"

   }

}

 

  • Send HTTP Request to SharePoint - Power Automate SharePoint Action

HTTP POST: _api/ProjectServer/Projects('ProjectGUID')/Draft/Update()

 

Header JSON

{

  "Accept": "application/json;odata=nometadata",

  "Content-Type": "application/json"

}

 

Body JSON

Leave blank

 

  • Check-in and publish Project - Power Automate Project Online Action

The images below show an example using the Power Automate Project Online Action for “Creates new task” which is unnecessary if you are using the Project Summary task or some other task that already exists to link to as the parent task:

 

Screenshot of the first few Power Automate steps for this solution

 

Screenshot of the final steps in the Power Automate flow to create the task under the summary

 

Thanks Daniel for sharing, and I hope this helps other people using Power Automate and Project Online to get their tasks flowing into their projects just where they want them!  

One Reply to “Project Online: Adding tasks where you want them with Power Automate”

  1. Hi,

    Thank you for this informative article. I would like to know, is it possible to create multiple tasks in a single “Add tasks” API call. May be by providing multiple tasks parameter in Body section.

    please do reply. I already tried this, but no success.

Leave a Reply to Nikhil Cancel reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.