ArunKr Super Contributor.
Super Contributor.
346 views

Update Project Request Fields via Webservice

Jump to solution

HI,

I'm trying to update few custom project fields in header section. they are not OOTB fields but user created fields. I'm not able to update them via webservice.

I tried the example in PM but donno if my code is correct not able to udpate Manager field. but able to update Project Manager via 

pb.addProjectManagerUserName("PM")

 

private void updateProjectPM(final String projectName, final String PM, final String MGR) throws RemoteException {

        // create the update project object
        final UpdateProjectDocument updateProjDoc = UpdateProjectDocument.Factory.newInstance();
        final UpdateProject up = updateProjDoc.addNewUpdateProject();
        final ProjectInputType pit = up.addNewProjectInput();
        pit.setProjectName(projectName);
        pit.getRequestId();
        
        // Create projectBean input
        final ProjectType pb = up.addNewProjectBean();

        String[] projMgr = null;
        projMgr = PM.split(";");
        
//set Project Managers int countPM = new StringTokenizer(" " +PM + " ", ";").countTokens()-1; //System.out.println("count of characters = " + (i+1)); for (int j = 0; j <= countPM; j++){ //System.out.println(projMgr[j]); pb.addProjectManagerUserName(projMgr[j]); } // Set custom field 'Manager' final SimpleField[] field_Mgr = new SimpleField[1]; final SimpleField field_A = SimpleField.Factory.newInstance(); field_A.setToken("REQ.MANAGER"); field_A.setStringValue1Array(new String[] {MGR}); field_Mgr[0] = field_A; System.out.println("System.out.println( : "+field_Mgr[0]); //pb.setSimpleFieldsArray( field_Mgr[0]); System.out.println(pb.getSimpleFieldsArray()); // Calling web service final ProjectServiceStub stub = new ProjectServiceStub(this.ctx, this.WSURL); stub.updateProject(updateProjDoc); }

I also tried to update the field from example given in DM module. It also failed.

Could someone help me if you have updated custom request fields (not OOTB fields) in a project? thanks.

0 Likes
1 Solution

Accepted Solutions
ArunKr Super Contributor.
Super Contributor.

Re: Update Project Request Fields via Webservice

Jump to solution

It worked...

again tried to udpate the fields via example given in DM module. it worked like charm.

my mistake was I was trying to do lot of actions in one class file (connecting to DM, PM, RM) modules all in one file and the loop some where failed.

when I tried to do them seperately it worked.

0 Likes
1 Reply
ArunKr Super Contributor.
Super Contributor.

Re: Update Project Request Fields via Webservice

Jump to solution

It worked...

again tried to udpate the fields via example given in DM module. it worked like charm.

my mistake was I was trying to do lot of actions in one class file (connecting to DM, PM, RM) modules all in one file and the loop some where failed.

when I tried to do them seperately it worked.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.