Can't update SP position forecast data using Interactive REST API

I have been attempting to update the position forecast data of a staffing profile through the Swagger UI using the POST function "/staffingProfile/saveHeader" which updates all header and position data in a SP. I was able to successfully update the description of the staffing profile, however, I've had no luck updating any kind of position data, including the position name and forecast hours. The code runs with no errors, but the SP position data doesn't update.

I would appreciate any advice on what is wrong, or how to figure out why it's wrong.

This is the code I'm currently executing:

{
"id": 39580,
"version": 66,
"name": "ABC - 2021-2022 PPM Managed Services",
"status": {
  "type": "ACTIVE"
  },
"region": {
  "id": 30000
  },
"startPeriod": {
  "id": 32563
  },
"finishPeriod": {
  "id": 32634
  },
"asWorkload": true,
"periodType": "MONTH",
"effortType": "HOURS",
"positions": [
{
  "id": 43483,
  "version": 5,
  "name": "Support Lead",
  "role": {
    "id": 30490,
    "name": "Operations Lead"
   },
  "laborCategory": {
    "type": "EMPLOYEE",
    "name": "Employee"
    },
  "periodForecasts": [
  {
    "rangeId": "32570",
    "startDate": "2021-07-01",
    "finishDate": "2021-07-31",
    "type": "HOURS",
    "hour": 100,
    "hourForecast": 110
    }
   ]

 }
],
"containerEntity": {
  "id": 47643,
  "containerType": "PROJECT"
 }
}

And this is the resulting Server response: (Response content type: application/json)

Response Body:

{
  "availableResourceTypes": [
    {
      "name": "Contractor",
      "type": "CONTRACTOR"
    },
    {
      "name": "Full Time Employee",
      "type": "FULL_TIME"
    },
    {
      "name": "Part Time Employee",
      "type": "PART_TIME"
    }
  ],
  "availableStatuses": [
    {
      "name": "Active",
      "type": "ACTIVE"
    },
    {
      "name": "In Planning",
      "type": "IN_PLANNING"
    },
    {
      "name": "Completed",
      "type": "COMPLETED"
    },
    {
      "name": "Cancelled",
      "type": "CANCELLED"
    },
    {
      "name": "Lock Down",
      "type": "LOCKDOWN"
    }
  ],
  "availableWorkloadCategories": [
    {
      "name": "Support",
      "type": "Support"
    },
    {
      "name": "Internal Initiatives",
      "type": "Internal"
    },
    {
      "name": "Delivery",
      "type": "Delivery"
    },
    {
      "name": "Admin",
      "type": "Admin"
    }
  ],
  "canViewCost": false,
  "data": {
    "active": true,
    "asWorkload": true,
    "containerEntity": {
      "containerName": "Project",
      "containerType": "PROJECT",
      "entityName": "ABC- 2021-2022 PPM Managed Services",
      "id": 47643,
      "subId": 54010
    },
    "createdBy": {
      "userId": 30132,
      "firstName": "ABC",
      "lastName": "EFG",
      "fullName": "ABC EFG"
    },
    "createdOn": "2021-06-11",
    "defaultResourcePool": null,
    "description": null,
    "editMode": "TABLE",
    "editableStatus": true,
    "effortType": "HOURS",
    "finishPeriod": {
      "endDate": "2022-06-30",
      "id": 32634,
      "longName": "June 2022",
      "shortName": "Jun 22",
      "startDate": "2022-06-01"
    },
    "id": 39580,
    "managers": [
      {
        "userId": 30132,
        "firstName": "ABC",
        "lastName": "EFG",
        "fullName": "ABC EFG"
      }
    ],
    "name": "ABC - 2021-2022 PPM Managed Services",
    "notes": [],
    "periodType": "MONTH",
    "positions": [],
    "region": {
      "id": 30000,
      "name": "US"
    },
    "rollupEnabled": true,
    "sensitive": false,
    "startPeriod": {
      "endDate": "2021-06-30",
      "id": 32563,
      "longName": "June 2021",
      "shortName": "Jun 21",
      "startDate": "2021-06-01"
    },
    "status": {
      "name": "Active",
      "type": "ACTIVE"
    },
    "syncBudget": true,
    "userDatas": [],
    "version": 68,
    "workloadCategory": {
      "name": "Delivery",
      "type": "Delivery"
    }
  },
  "hasError": false,
  "security": {
    "esFeature": {
      "compareBaseline": {
        "editable": false,
        "viewable": false
      },
      "moveAssignments": {
        "editable": false,
        "viewable": false
      },
      "movePositions": {
        "editable": false,
        "viewable": false
      }
    },
    "header": {
      "asWorkload": {
        "editable": false,
        "viewable": true
      },
      "budgetId": {
        "editable": true,
        "viewable": true
      },
      "containerEntity": {
        "editable": true,
        "viewable": true
      },
      "createdBy": {
        "editable": true,
        "viewable": true
      },
      "createdOn": {
        "editable": true,
        "viewable": true
      },
      "defaultResourcePool": {
        "editable": false,
        "viewable": true
      },
      "description": {
        "editable": true,
        "viewable": true
      },
      "effortType": {
        "editable": true,
        "viewable": true
      },
      "finishPeriod": {
        "editable": true,
        "viewable": true
      },
      "managers": {
        "editable": false,
        "viewable": true
      },
      "name": {
        "editable": true,
        "viewable": true
      },
      "notes": {
        "editable": true,
        "viewable": true
      },
      "periodType": {
        "editable": true,
        "viewable": true
      },
      "region": {
        "editable": true,
        "viewable": true
      },
      "sensitive": {
        "editable": true,
        "viewable": true
      },
      "startPeriod": {
        "editable": false,
        "viewable": true
      },
      "status": {
        "editable": true,
        "viewable": true
      },
      "syncBudget": {
        "editable": true,
        "viewable": true
      },
      "workloadCategory": {
        "editable": false,
        "viewable": true
      }
    },
    "id": 39580,
    "moreBtn": {
      "auditTrail": {
        "editable": false,
        "viewable": true
      },
      "changeHeader": {
        "editable": false,
        "viewable": true
      },
      "clearForecastAndAssignment": {
        "editable": false,
        "viewable": false
      },
      "configureAccess": {
        "editable": false,
        "viewable": true
      },
      "configureNotification": {
        "editable": false,
        "viewable": true
      },
      "delete": {
        "editable": false,
        "viewable": true
      },
      "exportExcel": {
        "editable": false,
        "viewable": true
      },
      "viewHeader": {
        "editable": false,
        "viewable": false
      }
    },
    "positions": {
      "editable": true,
      "viewable": true
    }
  },
  "syncEnabled": false
}


Response Header:
cache-control: no-cache  
connection: Keep-Alive

content-security-policy: default-src blob: 'self' 'unsafe-inline' 'unsafe-eval';img-src 'self' data: admhelp.microfocus.com;font-src 'self' data:

content-type: application/json
date: Thu, 11 Jul 2024 14:09:32 GMT
expires: -1

keep-alive: timeout=5, max=100

pragma: no-cache

server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.1e-fips mod_jk/1.2.23

service-worker-allowed: /

transfer-encoding: chunked

x-content-type-options: nosniff

x-frame-options: SAMEORIGIN

x-xss-protection: 1; mode=block
Parents
  • Verified Answer

    +1  

    Hi Jemina,

    Just using Swagger will not be helpful enough - the sample JSon payloads in it are automatically generated from code and aren't good enough examples to start from.

    You should instead update the data on the Staffing Profile Web UI in your Web Browser, and monitor all the REST calls done by your web browser to the PPM server. This will give you all the working payloads you need to perform the updates operations that are similar to what you're doing in the UI.

Reply
  • Verified Answer

    +1  

    Hi Jemina,

    Just using Swagger will not be helpful enough - the sample JSon payloads in it are automatically generated from code and aren't good enough examples to start from.

    You should instead update the data on the Staffing Profile Web UI in your Web Browser, and monitor all the REST calls done by your web browser to the PPM server. This will give you all the working payloads you need to perform the updates operations that are similar to what you're doing in the UI.

Children