Custom Items

If you're looking for a snippet to create a custom item object and/or to save an existing custom item within PI, then this snippet will provide you with a basic starting point.


//Create a model for the custom item
ProjectInsight.Models.CustomItems.CustomItem ci = new ProjectInsight.Models.CustomItems.CustomItem();
ci.Name = "Custom Item Test";

ci.Description = "Creating my first custom item within Project Insight via REST API Client";

//Set this to a valid Project Insight Container (Project, folder and other parent items)
ci.ItemContainer_Id = Guid.Parse("d3f3ee65-14dc-4276-994a-147a76df66ee"); 

//Guid of an existing custom item created in PI or specify the GUID of a custom item definition (Displayed in the Admin Customization section within PI)
ci.CustomItem_Id = Guid.Parse("004ad24b-07a7-4d9c-86ba-11fe833c6f8c");

//save the model
System.Threading.Tasks.Task saveCustomItemResp = this.client.CustomItem.SaveAsync(ci);

//return the results
var result = saveCustomItemResp.Result;    
The GUID for a custom item definition can be found in the "Customization Administration" section within PI.
Online 3/30/2018