Program or Solution team role not set will result in the message "Role with id -1 is not valid for this team.' when updating a User with the REST API 1.0.
This is reproducible on Data Center: yes
- Go to a program Team and add a member
- Make sure to not select a role as shown below:
- Use the GET method of the REST API 1.0 endpoint: https://<site-url>/api/Users/<userId> to retrieve the User information :
Notice that the team role id is set to -1:
- Use the PUT method of the REST API 1.0 endpoint: https:// <site-url>/api/Users/<userId> to update some of the User information (e.g. the title).
For this take the entire JSON of the response of the GET method and modify one of the values (make sure to keep the teams' information in the JSON body of the PUT request.)
As with API 2.0, the update is successfully done and no error is returned as we do not update the specific team with TeamRoleId=-1 nor do we try to set it to -1 (as it is already set).
The error below is thrown for any update made to the User record:
Use/Migrate API 2.0 instead of 1.0. The API 2.0 is the one we are consolidating.
Make sure to select a role when adding a User to the members of a Program or Solution Team.