cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ximo
Frequent Visitor

Updating Project Online Project OwnerID with Power Automate

Hi,

We are trying to update the Project OwnerID value using the below flow:

screensh1.png

FormDigestValue is extracted by parsing the body of:

screensh2.png

 

@body('Parse_JSON_2')?['d']?['GetContextWebInformation']?['FormDigestValue']

 

And Outputs is the ID of the SharePoint user converted to string:

 

string(body('Get_ID')['d']['id'])

 

According StackOverflow: How Do I Change The Project Owner Using REST API all looks good, the result is:

screensh3.png

But Owner is not updated and 22 is the correct UserID in SharePoint/Project Online we need to be the Project Owner.

Does anyone could please indicate what is missing?

Thanks in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
BillPricePMP
Helper I
Helper I

I was able to perform the same steps as you minus the X-RequestDigest.

Since I didn't see the whole flow my question was "Did you check out the project?  Did you check in and publish the project?"

Here is my simple flow with a project hard coded in and the value "84" hard coded to see if it works since it appears you are building the correct variables.  I was able to change to "22" and back to "84" without issue.

 

I hope you see something to help you.

Flow for update ownerID.pngupdate owner ID.png

 

 

View solution in original post

Thanks!

 

Yes, check out action happens before and check-in and publish afterwards, but found the issue to be not related to Power Automate, the particular user I was trying to change to Owner was on the SharePoint Site Collection/PWA with ID 22, the PWA was on SharePoint permissions mode, and this user was on Project Managers for Project Web App. 

 

But... for some reason it was not listed in the Pick Resource dialog that pops up when manually changing Project Owner.  Once I manually added the user to the Enterprise Resource Pool and appeared in the Pick Resource dialog list, the flow worked flawlessly!

View solution in original post

8 REPLIES 8
BillPricePMP
Helper I
Helper I

I was able to perform the same steps as you minus the X-RequestDigest.

Since I didn't see the whole flow my question was "Did you check out the project?  Did you check in and publish the project?"

Here is my simple flow with a project hard coded in and the value "84" hard coded to see if it works since it appears you are building the correct variables.  I was able to change to "22" and back to "84" without issue.

 

I hope you see something to help you.

Flow for update ownerID.pngupdate owner ID.png

 

 

View solution in original post

Thanks!

 

Yes, check out action happens before and check-in and publish afterwards, but found the issue to be not related to Power Automate, the particular user I was trying to change to Owner was on the SharePoint Site Collection/PWA with ID 22, the PWA was on SharePoint permissions mode, and this user was on Project Managers for Project Web App. 

 

But... for some reason it was not listed in the Pick Resource dialog that pops up when manually changing Project Owner.  Once I manually added the user to the Enterprise Resource Pool and appeared in the Pick Resource dialog list, the flow worked flawlessly!

View solution in original post

GreenData-JMS
Regular Visitor

For some clarity on this - I want to be able to use the claims ID, the email/UPN or the guid of the user. @BillPricePMP can you clarify your technique if you were providing any of those possibilities?

 

John-Michael Scott

GreenData.IO

@GreenData-JMS  The OwnerID was available for the metadata command but Enterprise Custom Fields I couldn't get it to work.  Check my other post where I use the GUID for each and every ECF I wanted.  I was bringing financial data from a spreadsheet into each project.  Each ECF has a GUID and I used JSON if I recall.  Post a picture of your flow so I can help rather than hypothesize.  I'm guessing you are trying to update ECF's on a project but correct me if I'm way off.


Read through this...and check the screen shot Update Project Custom Fields.

https://powerusers.microsoft.com/t5/Building-Flows/Optimize-updateCurrencyProperty-or-updateTextProp...

 

 

 

First we create a project - so 100% controlled experience:

 

CreateProject.png

 

Second - we want to check out the project created, so we insert a delay to wait for project creation to complete, after which we check out, and then attempt to use your technique to change the owner id. The presumption is that we are using Project Security rather than SharePoint Security:

ChangeProjectOwner.png

 

I provided the guid information to provide a sense for what we attempted. This failed as an action. 

 

Does this make sense and am I missing something?

 

Basically we are automating the act of project creation and we want to set the Project Owner - and ideally the Status Manager, but one bridge to cross at a time, you know? 🙂

 

Much thanks!

John-Michael 

 

 

@BillPricePMP Just noting this directly so that you might get a notification 🙂 It's like a black art trying to set ownerid here. 

OwnerID is not a Guid.  

@GreenData-JMS I cannot remember how to find the value OwnerID for a user.  So for example, I'm in project Online as BillPricePMP and my OwnerID is 84 but I dont know how I find that value without owning a project.  So, if GreenData should own all the projects upon creation, create a dummy project (or pick an existing one) and make GreenData the owner.  Get the Project Guid.  Then in a browser, type in the following command "https://<your site>/sites/pwa/_api/ProjectServer/Projects('<your GUID with dashes')/Owner"  This will return the XML and will include the OwnerID for GreenData.  If you have XML Notepad or similar its easier to copy and paste but if not, Find in your browser "<d:Id " and it will find this 

<d:Id m:type="Edm.Int32">84</d:Id>

That is your OwnerID (for me its 84) which you can use to change project owners to GreenData

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (46,769)