Rest API For Project Team
search cancel

Rest API For Project Team

book

Article ID: 254051

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

The following questions can be answered with REST API.

1. How many team staff members are on a project?
2. How can monthly allocations be updated?
3. How can 'Default Allocation (% Allocation) be updated?

 

Environment

Release: All

Resolution

The Clarity CRUD operations for the Project Team can be found by accessing
http(s)://<server>/niku/rest/describe/index.html#/Project


###
GET /{projectsInternalId}/teams/

The response body contains the count, e.g.
 "_recordsReturned": xxxxx

###
POST /projects/{projectsInternalId}/teams
Creation of teams.

###
DELETE /projects/{projectsInternalId}/teams/{teamsInternalId}
Deletion of teams.

###
PATCH /projects/{projectsInternalId}/teams/{teamsInternalId}
Partial object update of teams.

Additional Information

The following are examples:


A. How to update the monthly allocation of a staff member:

Call=PATCH
/ppm/rest/v1/projects/5xxxxxx/teams/5yyyyyy 

where 5yyyyyy is the resource member in the staff

{

            "isOpenForTimeEntry": false,
            "allocationCurve": {
                "curveType": "value",
                "dataType": "numeric",
                "_type": "tsv",
                "workEffortUnit": "hours",
                "periodList": [
                    {
                        "periodType": "months",
                        "periods": [
                            {
                                "start": "2022-05-01T00:00:00",
                                "finish": "2022-05-31T00:00:00",
                                "value": 176
                            },
                            {
                                "start": "2022-06-01T00:00:00",
                                "finish": "2022-06-30T00:00:00",
                                "value": 174
                            },
                            {
                                "start": "2022-07-01T00:00:00",
                                "finish": "2022-07-31T00:00:00",
                                "value": 173
                            },
                            {
                                "start": "2022-08-01T00:00:00",
                                "finish": "2022-08-31T00:00:00",
                                "value":172
                            },
                            {
                                "start": "2022-09-01T00:00:00",
                                "finish": "2022-09-30T00:00:00",
                                "value": 171
                            }
                        ]
                    }
                ]
            }
}

Result:

B. How to update Default Allocation (% Allocation)

 

Call=PATCH
/ppm/rest/v1/projects/5xxxxxx/teams/5yyyyyy

where 5yyyyyyis the resource member in the staff


{
    "defaultAllocationPercent": 0.333
}

C. Allocation segments are not able to be updated as this is strictly a Classic UI functionality, however the Per Period Metrics can be updated with example:

Call=PATCH
/ppm/rest/v1/projects/5xxxxxx/teams/5035002

where 5035002 the resource member in the staff


{
    "d": [
        {
            "_internalId": 5035002,
            "allocationCurve": {
                "pattern": "uniform",
                "periodList": [
                    {
                        "periods": [
                            {
                                "finish": "2022-08-31T00:00:00",
                                "start": "2022-08-01T00:00:00",
                                "value": 43.43
                            },
                            {
                                "finish": "2022-09-30T00:00:00",
                                "start": "2022-09-01T00:00:00",
                                "value": 56.56
                            }
                        ]
                    }
                ],
                "workEffortUnit": "hours"
            }
        }
    ]
}

The attribute 'isFiscal' indicates whether or not the curve is considered a fiscal curve or not.
For allocations, it is not. For cost plans, it is a fiscal curve.