Is it possible to programmatically move a WIT (PBI, Bug, etc.) from one Collection/Project to another?
I have a use case where a bug may be inadvertently opened under the wrong team project, and needs to be "moved" intact (history, attachments, etc.).
I've seen hacks that involve manipulating the underlying SQL tables, but I'd like a cleaner API-based solution.
You cannot move a work item from project to another or one collection to another. But you can copy it to another project in the same collection using the copy option in Web Access (manually). This actually just creates a new work item and copies all the matching field values to the new item.
If you want to do this in code or if you need to do this from one collection to the another collection you will have to create a new work item and copy all the fields you need over to the new instance. If you need the actual move experience you can destroy the old work item after the save of the new item is completed.
Note that you will always get a new ID both since ID's have to be unique within a team project collection. If moving items around is an ongoing concern for you consider moving all related teams into a single team project and use Team's to keep them aparte where necessary. You can move work items from one team to another within the same team project.
Related
I am using Azure DevOps WIT One Click Extension. I am trying to create a Rule to generate multiple Work Items (Child Tasks) when an specific Work Item gets saved or assigned to an individual.
I have tried over and over and the rule does appear for me to manually executed but it is not working to automatically generate the Tasks.
I have no code... I am not a Programmer or Developer. I am a user trying to use the tool
I expect the rule to work and automatically create the Child tasks when the Request Item (Parent) is saved or assigned to someone.
I'm afraid the trigger way you want does not support by this extension now.
generate multiple Work Items (Child Tasks) when an specific Work Item
gets saved or assigned to an individual
For this rule you would like -- save a specific work item and assigned to an individual are belong to trigger way -- as I understand, what you want is when a work item saved and be assigned to someone, it will trigger the action generate multiple child tasks.
So, in this rule, save a work item or assign it to someone is trigger way. The action is generate multiple child tasks. But, unfortunately, these trigger ways does not be support by this extension. It just support New work item load and Field changed now.
That's why it does not working automatically. Because the trigger way you configured not supported.
The rules you can create which also supported by this extension, is open a workitem or change one field will link a child task.
In addition, I also check the rules which Azure Devops support. The trigger way you want are also does not supported.
I'm using TFS 2013. In one field we have a Bug ID. It's a unique number and people often refer to it when working on projects (e.g., "Did you take care of bug 3456 yet?"). I know we get a Work Item ID with TFS (and that it is a unique number within a Team Project Collection), is there a way I can create a custom field that takes the first initial for the work item type and then attaches an the unique ID to it after? For example, for a bug it could be "B-3456" or for a task it could be "T-4242"? I'm just looking for a better way to way to organize ID numbers...
Work Item ID
The unique identifier that is assigned to a work item. Work item IDs
are unique across all team projects and within a team project
collection. Reference name=System.Id, Data type=Integer
If you want to change the work item ID from format "3456" to "B-3456". It's not able to do this, this ID is stored in TFS database and have various purposes such as work item query, TFS API and so on.
There is no easy Work Item Customization snippet you can apply to a new customize field to have it set to auto increment on save for a specific work item type. If you really want to do this, one way is follow Jesse Houwing's solution in this similar question.
And either in VS or in the web portal, it's easy to judge which work item type you are refer to. They have different icons or colors.
Sorry the poor English.
I'm using Visual Studio Team Services for a first time, and I follow the guided tour where I created three work items as example. Basic conceptions learned, I then deleted these first example work items and started to Create my own work items. Their numbering was sequential to the three first ones.
I managed to delete my Project to start a new one. I was think a new Project will start its work items from number 1 onwards, but the numbering from the deleted one is being used. I tried creating the repository with another Project name but no success.
I wasn't able to find how this is occurring, and it's very annoying to me. Someone has any idea about what's going on and how to correct this behavior (unless this is a feature)? Thanks in advance.
In TFS you have a Collection Database, that has a WorkItem table, all Work Item Id's are sequential in that table. A Collection contain one or more Team Projects. To reset the numbers you would have to create a new Collection.
In VSTS Collections are not a concept that you can manage, you have an account instead, you would probably have to delete and re-create your account - I don't think there is any way to create a new Collection in your account - I may be wrong, I'm only a personal user of VSTS.
I wouldn't worry too much about what ID's each work item has. I don't think it matters that much, you will soon lose control of them. Every WI you create has a new incremental ID, you you get Bug #1, Test Case #2, PBI #3, and so on. If you have >1 Team Project you will also end up with that taking ID's from you.
We are trying to impose couple of rules on our project , can you tell us if it is possible to do? and if yes where should I start on this?
One of the example rule is
Deliverable can’t be closed with non-closed children.
This means that even in resolved state a child item would block closing the deliverable.
This should apply to parent child link types only
This would only apply to deliverable parent and any type of valid child
There are two ways you can do this.
Server-side:
You can add a plugin to tfs, that changes workitems. A good example would be TFSAggregator. It won't have the solution for your specific problem, but I can show you how to change work items on the server side. Shouldn't be a big problem to add your case.
The problem with this solution is, that it only changes a workitem after it has been saved. So user will still be able to close the child, but the server will re-open it.
Client-side:
The second solution would be a custom control, which can be implemented in the WITD of your work item. It can be just an invisible control, that adds some validation. You can find some examples here.
The downside of this solution? You have to install the custom control on every single client that uses Visual Studio and you may have to develop a specific version for web-access.
I am using the TFS 2010 Scrum template and want to modify the Task work item template so that I can display the PBI's backlog priority (read only).
I am familiar with editing the process templates, but not sure I can setup a field to pull data from another work item
There are no rules available to get data from other work items. If you want to do this, you can either use the eventing service (which is a service that is invoked on work item save for example) or you can create a custom work item control.