ADD a PROJECT to a TEAM through API

I see in your documentation that the teams resource has “ ProjectIds ” property, which I think is no more valid, because I get error when trying to populate this property and I also downloaded your repository from GitHub, searched for TeamResource and found out that this property is now in ScopedUserRoleResource class…

Can you please give me an example of how to add a project to a team? I’m doing this in a powershell step.

OctopusDeploy version 2018.9.10
Have a great day!

Hi @ioan.stoita!

While I don’t have a script for this particular situation at the moment, we do have a Powershell script to remove a project from a team in our OctopusDeploy-API repository, which houses a bunch of handy scripts for interacting with the Octopus Server API. You should be able to simply modify this script to do exactly what you’re after!

Please don’t hesitate to let us know if you have any further questions.

This won’t work because this property ( ProjectIds) is in ScopedUserRoleResource now (checked the Git repository to find out this). If I’m trying to populate this property like in your example I get this error “New-Object : The member “ProjectIds” was not found for the specified .NET object.”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.