none
Read project detail using API RRS feed

  • Question

  • Hi,

    I have two SharePoint environments. In one Project Server is running while in another it's just SharePoint. Let's call these environments `PSE` and `SPE` respectively.

     So I am in SPE and trying to read project detail from PSE using API. Problem is there are many Enterprise Custom Fields such as Sponsor Name, Sponsor Units, Stakeholders Units etc. defined in PSE for which no data is being displayed in the API.

     I have tried the following but it is not showing value of these fields.

         http://PSE/PWA/_api/ProjectServer/Projects('abcdefgh-dc63-e811-810f-0050568b6b32')/IncludeCustomFields

         http://PSE/PWA/_api/ProjectData/Projects('abcdefgh-dc63-e811-810f-0050568b6b32')/?$select=StakeHoldersUnit

         http://PSE/PWA/_api/ProjectData/Projects(guid'abcdefgh-dc63-e811-810f-0050568b6b32')

     I am checking these URLs in IE and they are displaying other standard fields like project title, owner, creation date etc. but not the fields which I mentioned above. So I wanted to ask if it is because that enterprise custom fields are actually not available this way in API?
     
     Any other way to read that data? I have full access on both environments. Please ignore any formatting issues as I am typing from mobile.
    Wednesday, November 20, 2019 6:50 AM

Answers

  • Hi Frank,

    Try the below, please recheck the custom field names if there is any spelling mistake.

    http://PSE/PWA/_api/ProjectData/Projects?$select=SponsorName,SponsorUnits,StakeholdersUnits&filter=ProjectId eq guid'<<id>>


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    Thursday, November 21, 2019 6:41 AM
  • Opening URL ProjectData/Projects shows following XML StakeHoldersUnit data for all the projects.

    <d:StakeHoldersUnit m:null="true" />


    Opening URL ProjectData/Projects?$select=StakeHoldersUnit shows this for all projects.

    <content type="application/xml">
    <m:properties>
    <d:StakeHoldersUnit m:null="true" />
    </m:properties>
    </content>

    Even though I have confirmed that one of the project has following StakeHoldersUnit defined.

    After a lot of searching I came to know that the project register page where all this information is displayed for a project is actually a custom web part which is reading all this data from a custom database table in SQL Server.

    I believe this is why this data is not appearing in XML because developer didn't use standard method to insert/display data and is using custom method!? I am not much familiar with Project Server so I am not sure about it.

    Sunday, November 24, 2019 4:48 PM
  • Hello,

    Yes that will be why - you can tell by the screenshot that you just added, the web part / field selection control is a custom one and not an out of the box Project Server PWA one. Hopefully there would have been a good business reason to go down the custom development route rather than just configuration! 

    You might be able to pull some default data from the Project APIs / Reporting schema in the Project Web App database and the custom data from the SQL Database that contains the custom data like Stakeholder Units and join the data on the same key used in the custom web parts - Project ID etc.

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    Monday, November 25, 2019 9:40 AM
    Moderator

All replies

  • Hello,

    Those APIs do contain the enterprise custom fields and they are the way to read the project data. In IE, if you just run this http://PSE/PWA/_api/ProjectData/Projects does that show data for any custom fields for any project?

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    Wednesday, November 20, 2019 10:51 PM
    Moderator
  • Hi Frank,

    Try the below, please recheck the custom field names if there is any spelling mistake.

    http://PSE/PWA/_api/ProjectData/Projects?$select=SponsorName,SponsorUnits,StakeholdersUnits&filter=ProjectId eq guid'<<id>>


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    Thursday, November 21, 2019 6:41 AM
  • Opening URL ProjectData/Projects shows following XML StakeHoldersUnit data for all the projects.

    <d:StakeHoldersUnit m:null="true" />


    Opening URL ProjectData/Projects?$select=StakeHoldersUnit shows this for all projects.

    <content type="application/xml">
    <m:properties>
    <d:StakeHoldersUnit m:null="true" />
    </m:properties>
    </content>

    Even though I have confirmed that one of the project has following StakeHoldersUnit defined.

    After a lot of searching I came to know that the project register page where all this information is displayed for a project is actually a custom web part which is reading all this data from a custom database table in SQL Server.

    I believe this is why this data is not appearing in XML because developer didn't use standard method to insert/display data and is using custom method!? I am not much familiar with Project Server so I am not sure about it.

    Sunday, November 24, 2019 4:48 PM
  • Hi Frank,

    I can see in your response that the screenshot "StakeHolder Units" field name is not matching with the REST URL that you are trying. 

    Make sure you enter the exact field name without spelling mistakes  in the REST URL and Try again. 


    Rajkumar Allepu (MCP) , | https://sharepointprojectserver.com ** Please mark it as answer if my answer would resolved your issue.

    Monday, November 25, 2019 9:02 AM
  • Hello,

    Yes that will be why - you can tell by the screenshot that you just added, the web part / field selection control is a custom one and not an out of the box Project Server PWA one. Hopefully there would have been a good business reason to go down the custom development route rather than just configuration! 

    You might be able to pull some default data from the Project APIs / Reporting schema in the Project Web App database and the custom data from the SQL Database that contains the custom data like Stakeholder Units and join the data on the same key used in the custom web parts - Project ID etc.

    Paul


    Paul Mather | Twitter | http://pwmather.wordpress.com | CPS | MVP | Downloads

    Monday, November 25, 2019 9:40 AM
    Moderator