filtering results from new assignedRoles endpoint

We used to use the GET hubrestapi/projectroles endpoint to get a list of project roles.  This required using the project ringId.  With the new 2026.1 release, the hubrestapi/projects endpoint no longer returns anything since the projects resources are no longer in hub.  Is there an easy way to get the project ringId from the YouTrack rest API (I have not found one yet) or alternatively, is there a way to add a query to the ytrestapi/assignedRoles endpoint to filter b a specific project id/shortName?  Currently the project details are within the scope grouping "fields": “id,role(id,name,description),holder(id,login),scope(id,project(id,shortName,name))” and I can't work out how to target the “scope.project.shortName” as a query parameter.

0
1 comment

Hi Nick,
I'm Stan from the YouTrack Team. Thanks for reaching out!

As I can see, my colleague already shared a detailed reply on your support ticket. Reposting it here so other users hitting the same migration question can find it. I've also submitted an internal documentation update request to address the gap you mentioned about the ! suffix not being covered in the REST API docs.

Starting with YouTrack 2026.1, project roles are managed directly through the YouTrack REST API, and the Hub projects resource is no longer active. Here's how to update your workflow.

Getting the project ID

The Hub project ringId has no direct replacement, but you no longer need it. The YouTrack REST API uses its own project entity IDs (for example, 0-6), which the new endpoints accept. Retrieve them with:

GET /api/admin/projects?fields=id,shortName,name

You can narrow this down to a specific project by adding the query parameter:

GET /api/admin/projects?fields=id,shortName,name&query=PROJECT_SHORT_NAME

Filtering assigned roles by project

The /api/assignedRoles endpoint supports a query parameter for filtering. Use scope:PROJECT_ID! with the entity ID from the previous step:

GET /api/assignedRoles?query=scope:0-6!&fields=id,role(id,name,description),holder(id,login),scope(id,$type,project(id,shortName,name))&$skip=0&$top=100

The ! suffix matters. Without it, the response also includes organization-level and globally-assigned roles that apply to the project, not just the ones assigned at the project level, which is almost certainly not what you want. The ! restricts results to roles assigned directly to the project, matching what the old Hub projectroles endpoint returned.

A couple of things to keep in mind:

  • The scope.project.shortName syntax you tried isn't supported. The scope: filter only accepts a YouTrack project entity ID, an organization entity ID, or the literal string global. Passing a dotted path returns a 400 error.
  • The orderBy parameter from the old Hub endpoint isn't available on assignedRoles. Results are returned in a fixed order.

For background on which entities moved from Hub to the YouTrack REST API in 2026.1, please see Users, Groups, and Access Management.

Please don't hesitate to reach out anytime if you have any questions or need any assistance. Have a nice day! 

0

Please sign in to leave a comment.