Best Practice for Portfolio - Project relationship

eroth
Kilo Contributor

Looks like you can relate a Portfolio directly to a Project, but you cannot relate a project to a Portfolio. Is the Portfolio>Project a legacy design. and we should be using the m2m relationship between Projects and Portfolios.   Need your assistance on how these relationships should be working.

1 ACCEPTED SOLUTION

edwajs
ServiceNow Employee
ServiceNow Employee

Hi Everyone,



The many-to-many relationships, stored in pm_m2m_portfolio_project, are the correct method of associating projects to portfolios.   This allows the association of the same project to multiple portfolios, and as has been noted, is done primarily for reporting purposes.   Note that this is an indirect relationship to pm_project, because the reference fields in pm_m2m_portfolio_project are to pm_portfolio and pm_portfolio_project, and the pm_project reference in pm_portfolio_project is what is used to tie the pm_project to the pm_portfolio.



In newer releases of Project Management v3 after Eureka, the primary_portfolio field has been added to the pm_project table, and also the 'Add Project to Portfolio' business rule.   Even though primary_portfolio is a reference field, this is not the official relationship for any of the related lists on pm_portfolio and it has not superseded the many-to-many relationship.   This field is used with the 'Add Project to Portfolio' business rule to create a pm_m2m_portfolio_project record for you automatically.   This is to make it an easier process for creating this relationship, instead of the former two-step process of:


  1. Create the new pm_project record*
  2. Go to the pm_portfolio record, and use the Edit... button and slushbucket to add the pm_project to the pm_portfolio.


*Note that the business rule 'Update Portfolio Project' business rule is used to create the synchronized pm_portfolio_project record for the pm_project, which is then used in the pm_m2m_portfolio_project record.



Also note that there is a known issue for the 'Add Project to Portfolio' business rule, because it may not work properly in an instance which was originally Project Management v2 and upgraded to Project Management v3.



Regards,


Ed


View solution in original post

7 REPLIES 7

Also note that there is a known issue for the 'Add Project to Portfolio' business rule, because it may not work properly in an instance which was originally Project Management v2 and upgraded to Project Management v3.



Do you know if this has been fixed?  


edwajs
ServiceNow Employee
ServiceNow Employee

Hi Denise,



This was one of several fixes packaged for PRB663381, which was fixed in Fuji Patch 13, Geneva Patch 5, and Helsinki.



The specific details about this defect are:



The 'Add Project to Portfolio' business rule has the condition:   current.primary_portfolio.changes()



The error is because line 5 of the business rule, to check if the m2m relationship record should be created, is:   if(!current.pm_portfolio.nil()){



The business rule works in an instance which has only had Project Management v3 activated because the pm_portfolio field does not exist, and !current.pm_portfolio.nil() is always true (the expression is true because current.pm_portfolio is undefined, not null).



If you were Project Management v2 and activated Project Management v3, the pm_portfolio field does exist, but it is not on the form and is not populated, so the line 5 expression is always false and the relationship is never created.



You can correct the business rule yourself if you run into this issue and have not upgraded to a fixed version by changing line 5 to:   if(!current.primary_portfolio.nil()){



Regards,


Ed


edwajs
ServiceNow Employee
ServiceNow Employee

Hi Eric,



I wanted to follow up to see if this question had been answered for you.   If it has, you can mark this post.   If my response was not helpful or complete, please let me know.



Regards,


Ed