Basic tool for add an state to workitems in multiple Team Projects programmatically
#Introduction
What are you supposed to do when you want to add a status to a certain workitem on hundreds of different projects at the same time?
There are those who will say "Be patient to manually edit all XMLs", but others (like me) will say "Let's program".
This is a very basic tool but it can be useful as a starting point or as a reference when creating your own.
#Workflow TFSAddNewStateToWorkItem perform the following steps for each specified team project:
- Export the XML for the specified workitem
- Add the requested state
- Add the requested transitions
- Import the updated workitem XML
- Export the ProcessConfig file
- Add the requested state to the specified category
- Import the updated ProcessConfig file
#Getting Started To use the tool, just build it, open the cmd and run it:
AddNewStateToWorkItem {user} {password} {collectionUrl} {teamProjects} {workItem} {state} {transitions} {category} {stateType}
.
{user}: "Domain\UserName"
{password}: "Password"
{collectionUrl}: "http://TfsUrl:8080/tfs/DefaultCollection"
{teamProjects}: Team project names separetad by ',' ("tp1,tp2,tp3") or ("*") for all
{workItem}: Workitem Name (for example: Bug)
{state}: New State to add (for example: Open)
{transitions}: You can add several transitions and several reasons to the each transition separating them by ';'
--> Transition Syntax -> {direction}:{state}({reasons})
----> {direction}: from/to (from which state or for which state)
----> {state}: source state (for from) or target state (for to)
----> {reasons}: Several reasons can be added separating them by ',' (the first reason will be set as default reason)
--> For example: "from:New(Created);to:Active(Accepted,In Progress)"
{category}: In which category the states should be added in the ProcessConfig
{stateType}: Attribute "value" for the element State in the ProcessConfig (Proposed,In Progress,Completed)
.
Example:
AddNewStateToWorkItem "Domain\UserName", "Password", "http://TfsUrl:8080/tfs/DefaultCollection", "*", "Bug", "Open", "from:New(default,reason1,reason2);to:Active(defaultreason,reason4)", "In Progress"
Note:
The tool trusts you so doesn't do any validation (Only counts the number of parameters)
#Build
To build the application just open the solution in visual studio, make sure the references are not broken and build it.
Third party references are stored in the folder "References".
#Contribute
As I said earlier is a very basic project whose function is to be used as a starting point or used as a reference.
However feel free to contribute (just fork and open a pull request), your contributions can help others :)