I've received a request to create a custom report email for our executives. When we do a major release they want a list of Features of that release. What i need to do is read the related Tasks to the release then traverse up parent nodes until i get to the features that are marked with a tag "Executive". My Issue is that I can't find any document on how get the "Work items linked to associated changes".
I've been able to just through to get the specific build
GET http://XXX.MYTFSSERVER.COM/tfs/Collection/Project/e5e632e2-ae70-41c9-9d72-6686d2375f14/_apis/build/Builds/69330
But I don't see any link to get the workitems associated to the build.
Releases already do this out-of-the-box. On the Work Items tab of a release, you can have it generate an email that contains all of the work items associated with that release relative to an earlier release.
There isn't any build-in way to achieve this such as through TFS work item query. You need to build a extension to get all work items of specific release and filter them later.
The steps to achieve that with extension:
Get specify release to get build id
Get work items of that build per build id
Get related work items
Filter the work items which you actually need
A detail simple code of extension to get work items of specific release that you can refer to this link: TFS 2017 Release Management: How to display parent PBI for Tasks under Release
Related
I am looking for a way to produce all TFS Work Items from a Jenkins promote job.
We have an on prem deployment of TFS with service hooks in place to build the corresponding applications on check-in. The changeset Id is included with the notification, but I need the TFS work item for that Changeset.
More importantly - we will have several builds run; each with a singular changeset before we actuall run the promotion job.
What I would like to do is find a way to produce the list of TFS work items between releases. Looking a plug-in or tool that will help produce this.
Update
You should first get the built changeset info in Jenkins side.
There seems to be a build.changeSets variable which could retrieve all the changeset.
Then you could directly use rest api in TFS to query work items info from changeset ID. Detail steps kindly take a look at here: How to retrieve work items associated to a build in jenkins with pipeline?
According to your description, seems you just want to get all work items between releases (for example: the current release and a previous release).
Retrieve work items by calling
https://{account}.vsrm.visualstudio.com/[teamproject]/_apis/Release/releases/{current release id}/workitems?api-version=4.1-preview.1&baseReleaseId={release id}
It just return the id, url of work items, and then you need to get details of work item through Get a list of work items REST API.
I understand how to link work items to a build, but when viewing release results, I see a section listed for Work Items, and that you can compare work items linked from an artifact in different releases.
What I don't understand is how to get the work item linked from a build to show up in the release that was triggered to run from the build.
How can I do such a thing?
For example, in this post, they show their build results with work items linked, and then show their release with other work items linked. What steps do I have to take to make that happen for me?
To get linked work items to show up in a release, you just need to set the builds (show up work items) or the specific sources which associate work items with the changesets as artifact sources.
In the release summary, it compares the current release with the previous release and then displays the newly added work items associated with changesets.
Try below steps to achieve your requirement:
Create a build definition A, map sources to include the
files/items will be changed in source control
Edit and modify the files/items, check in the changes with work
items associated. (e.g. Task1 here)
Trigger build definition A to queue a build1 (Task1 should
display in Build summary)
Create a release definition B, and add build definition A as
the artifact source, then create a release. (Task1 should display
in release summary)
Edit and modify the files/items second time, check in the changes
with work items associated. (e.g. Task2 here)
Trigger build definition A to queue a build2 (Task2 should
display in Build summary)
Do not create release here
Edit and modify the files/items third time, check in the changes
with work items associated. (e.g. Task3 here)
Trigger build definition A to queue a build3 (Task3 should
display in Build summary)
Create a release now, Task2 and Task3 will display in the
release summary.
I noticed that work items can be linked to a build. But I don't see a way to automatically link the work items to the build.
On pull requests, we require pull requests to be associated with a work item. When the pull request is complete, the work item is updated with a link to the commits.
If I look at a branches commit history in TFS, there is a build column. I assume that the build column would contain the build that the commit is in, but it is always blank.
We want to be able to look at a build and see what work items are contained in the build.
Is there a way to do this?
The “Automatic linking of a build with associated work items” feature was released in TFS 2017 Update 2. You could enable this feature by toggling the setting under Options in your build definition:
In this way, each successful build associated with the work item automatically appears in the development section of the work item form.
More information you can refer to the blog below:
https://blogs.msdn.microsoft.com/devops/2017/08/25/automatic-linking-work-items-to-builds/
Is there any way to query work items that are part of a specific Release?
Thanks
There isn't the way to achieve that with query. You can try to build a extension to get work items of specific release.
Check this thread: TFS 2017 Release Management: How to display parent PBI for Tasks under Release
It can't be achieved by creating a basic query, we can see all the associated work items in release Work Items tab.
You can also check this question may be inspired
Can we get release information from checkedIN history.
we are using TFS 2012.
we have frequent release mostly on each week or on each 14 days.
Can we generate release document from TFS ?
(something like, based on TFS checked IN comments OR some how )
One way to do this would be to use Work Items (e.g. User Stories and Bugs) to generate your release notes.
But this requires your team to have the discipline to enter the information into TFS that allows it to associate work items with a release. For example:
Require developers to associate change sets with work items
Use fields such as "Iteration" or "Integrated in build" in work items to identify the release to which a work item belongs.
You could then create a suitable Team Query and export it to Excel to generate release notes.
I tend to use the Tf history command line tool to get information of changesets between two particular dates (or changesets). You can pass the /format:detailed parameter to get details such as changes involeed.
For example, the following will list all the changes between the 01/02/2014 & 24/04/2014 and write it to the history file.
tf history /noprompt * /recursive /v:D01/02/2014~D24/04/2014
/format:detailed > C:\history.txt
I like the TFS Changelog tool. Ready to use and easy to integrate.
TFS ChangeLog allows Team Foundation Server (TFS) users to extract information related to Changesets and associated WorkItems into XML format that is transformed into HTML.
All of these are nice tools, but there are a few things still missing I think.
These are technical notes (more like build / history notes) but actual release notes contain more customer friendly items
Not all of the information in TFS are wanted on the customer release notes (internally found bugs vs reported bugs)
As of now I use the TFS Community build manager to generate the technical build notes. It uses OpenXML and works fine for you build notes. It's even easy to create a custom word document for it.
For release notes we actually use the TFS User stories / tasks to be able to query on it. And for now, we create the document manually with the query results. We're looking into creating some tools that might do the following:
Run queries corresponding to the document paragrahs
We have a TFS template field indicating that the work item must be on the customer release notes (but we should change this to use 'special' iterations or so to eliminate the need of a custom field.
Automatically fill in the OpenXml placeholders in the document the same way as the build notes generator does.
Like the TFS Community Build Manager you could create a TFS Community Release Notes Manager that asks for query names and runs these queries to get to the required data.
The main question here is whether there are already tools that do this?
I know this is an old question, but perhaps you can use this task extension Generate Release Notes Build Task (for local TFS or as an extension to VisualStudio.com).
This extension is a build task you can use in build steps. This task generates a markdown release notes file based on a template passed into the tool. Here is an example of release notes output:
Release notes for build SampleSolution.Master
Build Number: 20160229.3 Build started: 29/02/16 15:47:58 Source
Branch: refs/heads/master
Associated work items
Task 60 [Assigned by: Bill ] Design WP8 client Associated change
sets/commits
ID bf9be94e61f71f87cb068353f58e860b982a2b4b Added a template ID
8c3f8f9817606e48f37f8e6d25b5a212230d7a86 Start of the project