Assign all Project groups except one in Teams

Hi everyone,

Is it possible to assign all project groups to a Teams but exclude one or two of them?

We manage a lot of project groups and it’s annoying to have to add all of them but the ones we don’t want. (Our current version is 2022.1.2733)

Thanks in advance for your answers.

Hi @douchet.pantoine,

Firstly, let me welcome you to the Octopus community :wave:

Thank you for reaching out to us with your questions.

Unfortunately you cannot do this using the Octopus UI. When it comes to the permission model within Octopus is inclusive, not exclusive.

However, you could look to programmatically achieve this using the Octopus REST API.

For example using the endpoint similar to below you could look to update the JSON to add only the projects groups you need (you will need to know which project group is which) scoped to your team(s).

https://{YourOctopusURL}/api/scopeduserroles/ScopedUserRoles-5

{
  "Id": "ScopedUserRoles-5",
  "UserRoleId": "userroles-projectlead",
  "TeamId": "Teams-1",
  "ProjectIds": [],
  "EnvironmentIds": [
    "Environments-1",
    "Environments-2",
    "Environments-21"
  ],
  "TenantIds": [],
  "ProjectGroupIds": [
    "ProjectGroups-302",
    "ProjectGroups-2"
  ],
  "SpaceId": "Spaces-1",
  "Links": {
    "Self": "/api/scopeduserroles/ScopedUserRoles-5"
  }
}

While we don’t have a specific example for you to use, we do have a few samples that could help you get stared.

If you also feel like this is a feature you would like to see in Octopus, you can raise this within our User Voice feedback.

I hoped this has helped.

Regards
Doug