addPortfolioPrograms

Purpose

This operation adds one or more programs to a parent portfolio.

Function

You can use this operation to add a set of programs to a parent portfolio.

Limitations

The maximum number of programs that can be added to a parent is 250.

Related Information

The following related operation:

Input

The following fields are required:

  • Long id - the ID of the parent portfolio

  • Long[] ids - an array of IDs of programs that need to be added to the parent portfolio

Return

This operation does not return any data.

Java Interface

AddPortfolioProgramsResponseDocument
addPortfolioPrograms(AddPortfolioProgramsDocument in)

Parameters

Description

AddPortfolioProgramsDocument

Wrapper for the input of this operation. The input includes the following fields:

  • Long id //parent portfolio ID

  • Long[] ids //IDs of the programs to be added to the parent portfolio

Java Examples

public void testAddPortfolioProgram(long portfolioId, long[]
ids) throws Exception {
       System.out.println("testAddPortfolioProgram started
...");
       PortfolioServiceStub PFM = new PortfolioServiceStub(ctx,
WSURL);
       AddPortfolioProgramDocument addProgramDoc =
AddPortfolioProgramDocument.Factory.newInstance();
       AddPortfolioProgram program =
addProgramDoc.addNewAddPortfolioProgram();
       program.setPortfolioId(portfolioId);
       program.setProgramIdsArray(ids);
       PFM.addPortfolioProgram(addProgramDoc);
       System.out.println("testAddPortfolioProgram completed");
    }

Errors and Exceptions

When an error occurs on this operation, you will see a description of the root cause in the server log or in the response message:

The server log content is similar to the following:

Exception in thread "main" org.apache.axis2.AxisFault: 
<exception:exceptionDetails xmlns:exception="http://www.mercury.com/ppm/ws/exception">
<exception:detail>[root cause description] </exception:detail>
</exception:exceptionDetails>

Possible root cause descriptions:

Message Code

Message

Cause(s)

Possible Corrective Action

exception.authorization

You do not have the privilege to take this action. Please consult your PPM Administrator.

You are not authorized to create a portfolio.

Check the user licenses and privileges (access grants)

com.mercury.itg.exceptions.ObjectNotFoundException

Cannot load the {0} with the specified id: {1}. {0} may be deleted by another user.

A portfolio/program with the specified name or ID cannot be found.

Check the portfolio/program name or ID.