i'm trying build widget visual studio team services dashboard.
when calling apis visual studio's rest clients, many api requires 'teamcontext' input. example:
ipromise<void> deleteteamiteration(teamcontext, id)
but how 'teamcontext'? tried:
var teamcontext = vss.getwebcontext().team;
but turns out there 2 types of teamcontexts (detailed below). vss.getwebcontext.team
gives first kind. while apis expect second kind.
how second kind of teamcontext?
first kind of teamcontext:
second kind of teamcontext:
edit: work around construct second type of teamcontext myself.
var teamcontext2 = { project : vss.getwebcontext().project.name, projectid : vss.getwebcontext().project.id, team : vss.getwebcontext().team.name, teamid : vss.getwebcontext().team.id };
it's not elegant thing, works.
the work around right way it. refer link msdn details: developing widget.
var teamcontext: tfs_core_contracts.teamcontext = { projectid: webcontext.project.id, teamid: webcontext.team.id, project: "", team: "" };