none
Get all projects from Project center 2016 filtered by … Active Projects only [Enterprise Custom Field] RRS feed

  • Question

  • Hi,

    How can I get a report of all Active Project in Project Center of Project Server 2016.

    Below fields ,

    Project Name | Project Stage | Project Status | Start Date | End Date | PM | Technical Lead | Is Baselined

    How can I get all projects which are active...Where Project Status = active ?
    How to read.... only active projects from project Center ?


    1- http://url.../_api/ProjectData/Projects/ 
    2- http://url.../_api/ProjectServer/Projects/  

    Thanks

    Saturday, June 20, 2020 6:49 PM

Answers

  • Hello,

    This will help get you started:

    {pwaSiteUrl}/_api/ProjectData/Projects()?$filter=ProjectStatus eq 'Active'&$select=ProjectName,ProjectStartDate,ProjectFinishDate,ProjectOwnerName,ProjectStatus,TechnicalLead

    Update the select for the correct / additional fields you want. If you are unsure of the fields take a look at: 

    {pwaSiteUrl}/_api/ProjectData/$metadata

    Using the ProjectServer REST API isn't as simple as you have to loop through all projects and use the internal field name for custom fields - as example for one project can be seen below:

    {pwaSiteUrl}/_api/ProjectServer/Projects('{projectID}')/IncludeCustomFields

    Paul


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

    • Marked as answer by mafab Sunday, June 21, 2020 7:39 AM
    Saturday, June 20, 2020 8:19 PM
    Moderator

All replies

  • Hello,

    This will help get you started:

    {pwaSiteUrl}/_api/ProjectData/Projects()?$filter=ProjectStatus eq 'Active'&$select=ProjectName,ProjectStartDate,ProjectFinishDate,ProjectOwnerName,ProjectStatus,TechnicalLead

    Update the select for the correct / additional fields you want. If you are unsure of the fields take a look at: 

    {pwaSiteUrl}/_api/ProjectData/$metadata

    Using the ProjectServer REST API isn't as simple as you have to loop through all projects and use the internal field name for custom fields - as example for one project can be seen below:

    {pwaSiteUrl}/_api/ProjectServer/Projects('{projectID}')/IncludeCustomFields

    Paul


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

    • Marked as answer by mafab Sunday, June 21, 2020 7:39 AM
    Saturday, June 20, 2020 8:19 PM
    Moderator
  • Hi,

    instead of display name , how to get them in  email  or account id format ... ProjectOwnerName, or TechnicalLead ?

    {pwaSiteUrl}/_api/ProjectData/Projects()?$filter=ProjectStatus eq 'Active'&$select=ProjectName,ProjectStartDate,ProjectFinishDate,ProjectOwnerName,ProjectStatus,TechnicalLead

    I trying to get them in email or account id format ?

    Please suggest,

    thanks



    • Edited by mafab Monday, July 27, 2020 1:56 PM clear
    Monday, July 27, 2020 1:52 PM
  • Hello,

    For the Project Owner email or account ID you will need to use a different endpoint or even a different API depending on what details you needed. For example, you get the ProjectOwnerId from the Projects endpoint then use the ProjectOwnerId to filter the Resources endpoint like below:

    {pwaSiteUrl}/_api/ProjectData/Resources(guid'6ee1c990-b9ec-e811-afb3-00155dc47d1d')


    That will provide details such as ResourceNTAccount & ResourceEmailAddress. Or you could use the CSOM REST API to get the SharePoint user details from the Project endpoint Owner related query: 

    {pwaSiteUrl}/_api/ProjectServer/Projects('{projectID}')/Owner

    That will provide details such as Email, Id, LoginName, UserPrincipalName.

    Technical Lead will be a bit tricky as that will just be a free text field I guess and not associated to an actual user object?

    Paul


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

    Monday, July 27, 2020 2:36 PM
    Moderator