TFS 2013 tbl_Branch Status without API - tfs

I have a need to get a list of all branches with paths and IsDeleted status. I can do this with the API from a development environment, but I will be unable to use the API in the production environment. A workaround is to query the TFS database for the data I need. I found the branches table (tbl_Branches), but it doesn't have a status column. I am not sure what I need to join on to find the status.
I am looking for the status that is from the property branchObject.Properties.RootItem.IsDeleted if using the API.
Does anyone know what to look at to get the same status for the branch as what the API uses?
Thank you.

The branches are tracked as items. So you need to join "tbl_Version" to get all the versions for the branches. The entries with "DeletionID" > 0 means ther are/were deleted. However, we don't recommend to query TFS Database directly just as Daniel mentioned in the comments. You should avoid this if you have any other workaround.

Related

TFS 2015-2017 Assistance

I am new to TFS and know the basic concepts. In my case we have customized TFS a lot which contains around 17 collections, custom fields in work items etc.
I have some queries for which I require some answers. The questions might be generic, but any help or suggestions on the below queries would be great.
Following are my queries:
1.) Show Work Item ID in a specific format. Can it be done
2.) Auto Fill custom fields for a work item based on a category / linked bugs (analogous to Relative Path column type)
3.) While raising a WI through Visual Studio development tool, the datepicker only takes date value and not time. The same work items when raised through web portal the datepicker gives time value as well.
4.) Auto Fill the efforts spent in Child Work items (summation of all child link items in the parent)
5.) Reminders to be sent if iteration / scrum set date crossed. Also check for Work Items as well, if set date is crossed.
6.) Create Queries which can query across all collections / verticals. Currently queries can be made only against each entire collection, but not across all collections. Do we have any mechanism to query against multiple collections?
7.) Email alerts customizations in TFS.
8.) Can the collections be merged into 1 default collection.
I have tried to find few answers from my end as well, and would like to know, if it is correct.
1.) Work Item ID cannot be shown in a specific format as it is system generated
2.) For Auto Filling of Work Item fields, it cannot be done. Manual approach is the only way (unless there is a way to pre-populate fields
3.) One can only query for all projects in a single collection. But it is not possible to query against multiple collections and get the results.
So require assistance on the above queries and also validate the answers I have got for few of my questions.
Any help or suggestions or relevant links would be great.
Thanks In Advance!!!..
Please kindly check below inputs
You are right. This is by designed. You can not change to use other
format of work item.
Yes. This could not be done at present. It's still a user voice, but
on the Roadmap. Support for calculated fields and roll-ups.
Sorry, not get your point.You could use the DateTimeControl type to give users a calendar picker to select a date for a DateTime field. By using this control, you can quickly select a date and time for the field. For details.
You could do this from a sprint backlog or task board. Details
please take a look at our official tutorial here: Rollup of work
and other fields
We do not have this kind of build-in time reminder for work items.
However, as a workaround, There is a dashboard widget that uses #me
in its query.
You can also cobble something together using the REST API and a
scheduled build. Calling a work item query and sending email is
pretty easy from PowerShell.
No, they are using different database. You are only able to query
across team projects int the same project collection.
It's able to do this but with a little bit complicated. For detail
info, please take a look at this link: Customize TFS 2015 alert
email
There is no default way to do this. I do not think there is a
possibility of merging two TFS collections other than creating a new
collection, creating the team projects and use a tool such as TFS
integration tools to move the team projects from the source
collections.
As you can see, history will be rewritten with new dates, changeset
and work items ids etc, if you are trying to merge collections.

TFS Query for Changesets without Code Review

Anyone knows how to search for changesets with no Associated Code Review with a TFS Query or similar? It can be also a query on TFS Data Warehouse.
When you request a code review from a changeset, it's not Bi-directional, only link one way.
This means you can't directly know if a changeset was code-reviewed or not from changeset ID. To get the association, you need to go through work item. There 's a work item called code review work item, a sample query as below, through that way you could find the code review work item for any changeset, as long as that changeset was associated with a TFS work item.
However, for your requirement, it's not able to use a work item query to do this. You may have to use TFS API to ahcieve it just as jessehouwing suggested.

Is it possible to get a TFS workitem snapshot for a specific date using TFS query?

I require to get all "Bug" entities from a TFS Team Project, for a specific date, it means that entities atributes should have values they had the date I specify. Kind of all bugs snapshot for a specific day.
Is it posible to do via a TFS query?
Thanks for your attention.
Probably you can not do this via standart tools provided by TFS portal.
But there is TFS API for you. Look at WorkItemStore class. It has many methods including GetWorkItem(Int32, DateTime) Gets the previous state of a work item that is specified by ID and date. https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.workitemstore.aspx

Can I manually overwrite the Changeset ID?

I'm trying to switch from SVN to TFS, and I'm wondering if there's any way to manually set the TFS Changeset ID to match my SVN Revision number. I have a few internal tools that perform some automated tasks based on the SVN revision, and they're all going to stop working if the revision number changes from 2,050 back down to 1.
I'm sure this isn't really the optimal way to handle these internal processes, but it's working for us and we'll probably only be using these tools for the next 12-18 months, so I don't really want to rewrite them. Any ideas would be appreciated.
I doubt that you get to set TFS changeset IDs. However, usually when migrating between source control systems, you use some tool/script that migrates the history, creating checkins that match the original checkins in content (not in IDs though), and that might set the changeset IDs more to your tools' liking.
It's controlled by the in tbl_ChangeSet.ChangeSetId field in the collection DB. It's an hack but you should be able to drop the primary key constraint, assign it with any value, and set back the primary key.
A safer approach would be creating a custom Check-In Note ("SVN Revision") for storing the original revision numbers.

TFS workitemsare table

Does anyone know what this field [Not a Field] means in TFS WorkItemsAre table? I am trying to understand the schema and this is not making any sense to me.
Accessing the operational datastore is not supported as in every release we will make break changes. You'd rather move to the TFS API or the TFS Warehouse database to get the data your are interested in.
What is it that you are after?

Resources