1
votes

Im attempting to create my first azure devops extension to plug a gap we have but I'll be honest I'm a little stuck.

I am using the new react templates from MS and have successfully created the shell of my extension that renders a tab item in the iterations board. This displays successfully in devops when deployed.

I now want to retrieve all work items for the visible iteration. I can see that the iteration id is available via the webContext. I can also see that its accessible via the VSS object, however the new typescript model takes a totally different approach:

public componentDidMount() {
    SDK.init();
    
    this.initializeComponent();
}

private async initializeComponent() {
    const projects = await getClient(CoreRestClient).getProjects();
    this.setState({
        projects: new ArrayItemProvider(projects)
    });
}

for example.

Does anyone know out there how to get the webContext using the SDK object or how I would go about getting the current displayed iteration id, project and team....so i can at least use a wiql query to get what i need?

Any help is appreciated.

Lee

1

1 Answers

0
votes

I have been wrestling with the same issue. I have discovered that this isn't supported yet in the new SDK. Just to try something out I forked the sdk and modified it and I am able to get the webContext. However I myself am trying to develop a Dashboard Widget and realized that getting webContext was just one of many things that are missing from the new SDK. Hopefully Microsoft will do something to complete this new SDK - there are many comments under the issues tab of their git repos with people complaining about how unusable it is.