Identifying work items which have been released via VSTS API - azure-devops

Trying to determine which VSTS Work Items have been released to a given Environment (production). Ideally looking for a Service Hook to tell me when work items are deployed so we can keep the rest of the company updated on when items are deployed.
Cannot find this available in the VSTS API.
In the VSTS UI under the Release Summary tab it shows linked Work Items. However linked Work Items don't appear to be available via the API.
VSTS API docs for Get Release
In the VSTS UI under each Work Item, it shows when it was integrated into a build, however not when that build has been released.
Any ideas?

There's a REST API, you're just looking in the wrong place for it. BTW, you can find this stuff easily by looking at the network traffic in the F12 tools in your browser.
https://<accountUrl>/<Project>/_apis/Release/releases/<ReleaseID>/workitems?baseReleaseId=<ReleaseToCompareAgainst>&%24top=250

For your question:
Ideally looking for a Service Hook to tell me when work items are
deployed so we can keep the rest of the company updated on when items
are deployed.
The deployed work items information is already included in the Release Deployment Service Hooks as below:
So you just need to create a Service Hook for Release deployment completed event and create a web service to listen on this.

Related

Access to GitHub Deployments Dashboard

Good morning!
I have been playing around with GitHub Actions to build and deploy to multiple stages. Works like a charm.
But deployments in GitHub has been hard to overview.
I have access to Environments, which is where I’ve added some secrets.
I found this article in the docs, but I can’t find it in my public repo. https://docs.github.com/en/github/administering-a-repository/viewing-deployment-activity-for-your-repository#viewing-the-deployments-dashboard
Does anyone know how GigHub deployments work and how to start using it?
"Github Deployments" is really just an API you can use to alert Github about deployments (start/finish) and the Deployments Dashboard to view activity. In order for anything to show up there you first need to actually trigger a Github deployment event and specify an environment. Put the action I've linked below at the start and then end of your existing deployment automation in Github Actions and you should start seeing something show up.
Deployment Action
https://github.com/bobheadxi/deployments
You should probably give this a read through as well, goes into details on where the Github Deployments API fits into things.
https://docs.github.com/en/rest/reference/repos#deployments

Updating Azure DevOps Environment Resource Tags through the API

I am trying to figure out how to update the associated tags with an Azure DevOps Environment Resource (virtual machine) through the Azure DevOps API.
I have figured out how to get the resources for a specific Environment - https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}?api-version=6.0-preview.1
However, if I try to update and then post back the Environment JSON with the updated resource tags, it does not actually update the resources. I think it is only for updating the Environment Name and Description?
I have trying to figure out how to use the following API endpoint (I think this is the one I should be using?) - https://dev.azure.com/{organization}/{project}/_apis/distributedtask/environments/{environmentId}/providers/virtualmachinegroups/{resourceId}/virtualmachines?api-version=6.0-preview.1.
The API endpoint wants a "resourceId" but I am not able to get anything back besides a 404 error when I put in the Environment Resource Id's for my Environment. I am not sure if I am doing something wrong, or this is the wrong end point.
Does anyone have an experience with using the API to update resource tags?
I can reproduce above issue. Currently, You have to manually edit the Environment Virtual machine Resource Tags.
Azure devops Environment Resource Rest API is not fully developed yet. Some features may be broken and unavailable currently.
You can report this issue to Microsoft Development Team. Hope they will fix it in the future sprint.

How to access Azure DevOps deploy comments from REST API

I've been able to successfully access all kinds of details around a release in Azure DevOps by leveraging the .NET client libraries (ex: Microsoft.VisualStudio.Services.Release.Client) that wrap the REST API. However, I can't seem to find what the object/property combination is that I would use to retrieve the comments that can be entered when kicking off a deployment to a specific environment.
To be clear, the comments I'm looking for are entered by hovering over an environment of a release and selecting "Deploy". On the right hand side there is a dialog in which comments can be entered and then another "Deploy" button is selected to kickoff the deployment.
Does anyone have any ideas on how these deployment comments can be read by using the Azure DevOps REST APIs or .NET client libraries?
You can use get release history REST API to get deploy comments:
Get https://vsrm.dev.azure.com/{Organization name}/{Project name}/_apis/Release/releases/{Release Id}/history?api-version=6.1-preview.1
Here is my sample:

Service Hook of Pull Request created is not being triggered when Pull request is created through Team Services REST API

I'm trying to integrate my Visual Studio Team Services with Slack, and the first thing I tried to do was notify my Slack channel whenever a Pull request is created.
So I searched through the options, and the best fit so far was the Service Hooks available on Team Services, which integrate seamlessly with Slack, or does it?
The problem I encountered was: I use a tool that creates pull requests through the REST API, and the service hook doesn't seem to be working when I create pull requests through this method, only when using Team Services UI.
This is the Service Hook configuration.
Has anyone faced the same problem, or know any other way of notifying a pull request creation to slack?
Apparently the issue has been fixed by Microsoft, the last update of Team Services triggers the event without a problem now.

Adding custom status page to Jenkins instance

I want to use the REST API that comes with Jenkins to generate a status page which shows all my projects, the environments they're currently deployed to, latest build versions etc.
Jenkins provides a nice REST API to expose this info however consuming the service is limited by cross domain restrictions. I have looked briefly at creating a CORS filter for my Jenkins instance but its overkill for what I'm trying to achieve.
Can someone tell me if its possible to modify my Jenkins WAR (instance) and add some HTML which i can then modify to call the RESTful endpoints? Ideally i want something whereby i can simply navigate to http://myjenkins/project-status and see the required information.
I assume your status page has some Javascript executing XMLHttpRequests. You could drop your status page files into $JENKINS_HOME/userContent directory on the master. This way they are served by Jenkins and should be able to access Jenkins REST APIs.