Share via

How to Fetch Team ID and Team Name in Azure DevOps Work Item Form Extension (without REST API)?

Rajneesh Sheth 10 Reputation points
2025-07-21T04:06:34.52+00:00

Hello Microsoft Dev Team,

Scenario: I am developing a custom Work Item Form Extension for Azure DevOps using the officially supported Extension SDK (v4.x). My requirement is to fetch the Team ID and Team Name for the currently logged-in user in the context of the selected project.

Problem:

  • The SDK context objects (SDK.getWebContext(), etc.) do not provide team information inside Work Item Form extensions.

The only widely recommended method is to call the Teams API via CoreRestClient.getTeams(projectId, true), which works but is a REST API call, not a direct context property.

Many organizations (including ours) would prefer not to make REST calls if the context is already known to the host/SDK.

Question:

Is there a built-in or alternate way, other than using the REST API, to access the current user’s Team ID and Team Name in a Work Item Form extension (e.g., via SDK context, host variables, or another extension contract)?

Are there any plans to expose team context directly in future SDK releases for Work Item Form extensions?

If not, is there any officially recommended workaround besides calling getTeams and filtering for the current user?

References:

Current Official Docs for CoreRestClient.getTeams()

Azure DevOps Extension Work Item Context

GitHub Issue #32 - Team Context in Work Item Extensions

What I’m Looking For:

A way to fetch team context without making a REST API call in Work Item Form extensions (if possible).

Or, confirmation that the REST API is the only way, with possible roadmap notes.

Thank you!Hello Microsoft Dev Team,

Scenario:
I am developing a custom Work Item Form Extension for Azure DevOps using the officially supported Extension SDK (v4.x). My requirement is to fetch the Team ID and Team Name for the currently logged-in user in the context of the selected project.

Problem:

The SDK context objects (SDK.getWebContext(), etc.) do not provide team information inside Work Item Form extensions.

The only widely recommended method is to call the Teams API via CoreRestClient.getTeams(projectId, true), which works but is a REST API call, not a direct context property.

Many organizations (including ours) would prefer not to make REST calls if the context is already known to the host/SDK.

Question:

Is there a built-in or alternate way, other than using the REST API, to access the current user’s Team ID and Team Name in a Work Item Form extension (e.g., via SDK context, host variables, or another extension contract)?

Are there any plans to expose team context directly in future SDK releases for Work Item Form extensions?

If not, is there any officially recommended workaround besides calling getTeams and filtering for the current user?

References:

Current Official Docs for CoreRestClient.getTeams()

Azure DevOps Extension Work Item Context

GitHub Issue #32 - Team Context in Work Item Extensions

What I’m Looking For:

A way to fetch team context without making a REST API call in Work Item Form extensions (if possible).

Or, confirmation that the REST API is the only way, with possible roadmap notes.

Thank you!

Rajneesh Sheth

Azure DevOps
0 comments No comments

6 answers

Sort by: Most helpful
  1. Rajneesh Sheth 10 Reputation points
    2025-07-24T11:49:11.0033333+00:00

    Hi

    Please check i tested the same code with 10 seconds , 15 seconds and indefinite delay but still teamid and team name does not fetch

    15 seconds time out error.png

    Was this answer helpful?


  2. Rajneesh Sheth 10 Reputation points
    2025-07-22T13:11:58.64+00:00

    please suggest how do i share privately ?

    Regards,

    Rajneesh

    Was this answer helpful?

    0 comments No comments

  3. Rajneesh Sheth 10 Reputation points
    2025-07-22T08:22:54.23+00:00

    Hi , with REST API i am unable to fetch Teamid and Team Name , i am using JavaScrip to write the REST API while fetching it is waiting for SDK to be ready with await SDK finally it fails

    kindly suggest

    Was this answer helpful?


  4. Rajneesh Sheth 10 Reputation points
    2025-07-21T12:26:59.5333333+00:00

    Thank You.

    Please close the request

    Was this answer helpful?


  5. Durga Reshma Malthi 11,595 Reputation points Microsoft External Staff Moderator
    2025-07-21T08:56:57.0266667+00:00

    Hi Rajneesh Sheth

    As of the latest, there is no officially supported way to retrieve the current user's Team ID or Team Name directly from the Work Item Form Extension context without using a REST API call.

    SDK.getWebContext() does not include team information for Work Item Form extensions.

    As confirmed in Azure DevOps GitHub issues CoreRestClient.getTeams(projectId, true) - this is the only officially recommended and supported method to retrieve team information.

    Here the true flag includes teamMembers, which you can use to filter the current user.

    Additional References:

    https://stackoverflow.com/questions/64472066/how-to-get-current-team-id-in-the-newer-azure-devops-extension-sdk-package

    Hope this helps!

    Please Let me know if you have any queries.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.