Within Microsoft Teams it is possible to create PowerApps by adding a new tab and then select the PowerApps Icons.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

This of course gives you unlimited options to create new applications without any coding work. Today, I tried to create an app that helps me maintain my Visual Studio Team Services backlog within Microsoft Teams.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

I selected my app and then the app that I created in PowerApps is added to my set of tabs in my Microsoft Teams channel. Note that the app only becomes available after you have created it within PowerApps.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

 

So far I’ve only created the app form a blank template. Next step will be to update my data source. This should be easy. I’ve done this many times with SharePoint lists so what could possibly happen.

Within my PowerApp I’ve added a Gallery control.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

As you will notice the Data source is not correct yet and some sample data is being used.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Simply add the data source by selecting Visual Studio Team Services or click on +New connection if you haven’t connected to  Visual Studio Team Services before

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.And you will find that the Visual Studio Team Services data is available.

That was easy!

But, my data source still says CustomGallerySample, Aahhh.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.I did notice that the Visual Studio Team Services connection is marked with Preview, but this must be a really early preview as the only thing you can do with it is see its existence. Well, at least we might now know what is coming up.

Not wanting to give up yet. I started to reopen the app that I just created.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

So even though initially it looked like the connections didn’t work. The data source does seem to be available.

So in my Gallery control, I’m now running the ListAccounts. ( I could have done something like VisualStudioTeamServices.ListAccounts().value.accountName to get all the account names, but I’m connected to a few customer accounts and therefore for the purpose of the screenshots in this post I’ve simplified things a bit)

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Then I’ll try to display the accountName:

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Then an helpful tooltip appears:

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Ok, So I’m still getting the wrong data type returned but at least my connection is recognised. I would like to get some text back. So by using the Last(…) function I’m picking up one of the accounts connected to my account that I used to connect to the data source.

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Ok, Now we are up and running. Now I can use the ListIterations using the above account and the project name and team name:

VisualStudioTeamServices.ListIterations(“<Project>”,”company name”,”<Team>”)

Microsoft Teams - Integration with Visual Studio Team Services using PowerApps.

Ok, this is only the start of the app.

I’ve create a PowerApp that now lets me queue a new build and start a release using PowerApps. So anybody in my development teams can now release software to a customer’s test systems by just clicking on a button in Microsoft Teams. This already has saved us a lot of time and more importantly many mistakes are avoided.

What else can be done using PowerApps? First I’m having a look at the options available within the VisualStudioTeamServices connection. The following Methods/Functions are available:

  • ListAccounts
  • ListBuildDefinitions
  • ListGitRefs
  • ListgitRepositories
  • ListIterations
  • ListProjects
  • ListReleaseDefinitions
  • ListTeamMembers
  • ListTeams

ListAccounts

The ListAccounts function retrieves the list of accounts the user is a member of. So this is when you login to VSTS and when you are connected to multiple organisations you will get a dialog asking you which account to connect to.

Syntax:

VisualStudioTeamServices.ListAccounts().value

This returns a record with the following fields

  • accountId – This is a guid of the account
  • accountName – this is the name of the account
  • accountOwner – This doesn’t seem to be set in my environment so not sure if this is working yet
  • accountType – Either personal or business
  • accountUri – The Uri of the account for this is something like https:/ /company.vssps.visualstudio.com:443/
  • organzationName – This is always blanks for my environments.
  • isSelected – this is set to true when the current item is selected.

ListBuildDefinitions

The ListBuildDefinitions function retrieves a list of build definitions that you have created as part of your project in VSTS

Syntax:

VisualStudioTeamServices.ListBuildDefinitions(project,account).value

where project is the name of the projewct returned by the ListProject method described below.

ListBuildDefinitions returns a record with the following fields

  • id – This is a guid of the build
  • name – this is the name of the build
  • _links – This returns web objects. ThisItem._links.web.href gets the url of a web, but I’m not sure what this is referring to as i’m not getting any results back
  • revision – the revision of the build
  • type – Either build or draft

ListGitRefs

The ListGitRefs function retrieves the list of references (branches, tags, etc) in a git repository.

ListGitRepositories

The ListGitRepositories retrieves the list of Git repositories in a project. These are all the forks that have been created within the project.

Syntax:

VisualStudioTeamServices.ListGitRepositories(project,account).value

ListIterations

The ListIterations function retrieves a list of iterations for a project

Syntax:

VisualStudioTeamServices.ListIterations(project,account,team).value

This returns an object with the following fields:

  • Id – the id of the iteration
  • Name – the name of the iteration e.g. Iteration 1
  • Path – The path to the iteration. e.g. Project\Iteration 1
  • Url – The url of the iteration
  • _links
  • Attributes – this contains the start and finish date of the iteration
  • IsSelected – is this iteration selected?

ListProjects

The ListProjects function retrieves a list of projects for an account

Syntax:

VisualStudioTeamServices.ListProjects(account).value

  • name – the name of the project. You will need to use this in for example the ListBuildDefinitions
  • id – the unique id of the project
  • url – the url of the project
  • isSelected – is this project selected?

ListReleaseDefinitions

The ListReleaseDefinitions function retrieves a list of release definitions that you have created as part of your project in VSTS

ListTeamMembers

The ListTeamMembers function retrieves a list of members in a team

ListTeams

Lists the list of teams in a project

Syntax:

VisualStudioTeamServices.ListTeams(project,account).value

this will return an object with the following field for the team

  • name – the name of the team.
  • id – the unique id of the team
  • url – the url of the team
  • description – the description of the team
  • isSelected – is this teamselected?

 

Ok, all of the above only list information. Is it possible to do anything other than listing information? Yes there is!

CreateRelease

The CreateRelease will create a release using the Release Definition IDs as you can get them using the ListReleaseDefinitions function

Syntax:

VisualStudioTeamServices.CreateRelease(“ContextIS”,”triad”,ThisItem.Id,{Description:”Test”,IsDraft:true,Reason:”Test from PowerApps”})

 

CreateWorkItem

The CreateWorkItem function lets you update workitems, so now you can manage your backlog directly form Microsoft Teams

QueueNewBuild

When you want a build to happen you could use your continuous integration configuration triggers on code check-in, but imagine that you could get this done by clicking on a button in Microsoft Teams? QueueNewBuild makes this possible!

UpdateWorkItem

Like the create work item, it is also possible to update work items using UpdateWorkItem.

 

So now it is all a matter of finding new use cases and implement them using PowerApps. OK, the options might be a bit limited, but I can definitely see many needs that could be implemented with new applications in PowerApps.

 

For more  details  in the available options please have a look at the article below:

https://docs.microsoft.com/en-us/connectors/visualstudioteamservices

 

 

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading