Read Project Team Using CSOM in Project Online

Read Project Team Using CSOM:-

Read Project Team Using CSOM in Project Online. In this post, I explain to Read Project Team Using CSOM. The project team is responsible for completing them a respected task. Below query shows how many no of task assign to a resource on a particular project. Below is complete code  to get project team using CSOM[AdSense-A]

string sitename = "OnlinePWAPath";
string usename = "usename";
string password = "password";

using (ProjectContext cc = new ProjectContext(sitename))
{
SecureString passWord2 = new SecureString();
foreach (char c in password.ToCharArray()) passWord2.AppendChar(c);
cc.Credentials = new SharePointOnlineCredentials(usename, passWord2);
var projCollection = cc.LoadQuery(cc.Projects.Where(p => p.Name == "airtel"));
cc.ExecuteQuery();

PublishedProject proj2Edit = projCollection.First();

DraftProject projCheckedOut = proj2Edit.CheckOut();// if project is checkout then check in
cc.Load(projCheckedOut.ProjectResources);
cc.ExecuteQuery();
foreach (var item in projCheckedOut.ProjectResources)
{

Console.WriteLine("Res Name:" + item.Name + " Id: " + item.Id);
}

}

Leave a 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.

error: Content is protected !!