microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
127 stars 40 forks source link

pageContext.webContext is {} in SDK.getPageContext() response #111

Open kalyanchakravarthys opened 3 months ago

kalyanchakravarthys commented 3 months ago

I published my ado extension to marketplace

On testing I noticed pageContext.webContext is {}, I was expecting it to have project and team information

Here is the code, what am I missing??

I need to fetch the project and team information for the page.

"azure-devops-extension-sdk": "3.1.3",


    public componentDidMount() {
        console.log("Initiating SDK");
        SDK.init().then(() => {
            // Get project and team context from the page context
            console.log("Getting Page Context");
            const pageContext = SDK.getPageContext();
            const project = pageContext.webContext.project;
            const team = pageContext.webContext.team;

            console.log("Project and Team", project, team);
            this.setState({ project, team });
        })

    }
mouadyoussef commented 2 months ago

I'm having the same issue.