1
votes

I'm trying to use "Global Workflow" feature of TFS to have maintainable Work Item Customization.

Only resources I could've found is these two from msdn:

There are two problems I couldn't find a solution:

From the definitions I have a globalWorkflow.xml like below:

<?xml version="1.0" encoding="utf-8"?>
<GLOBALWORKFLOW>
<FIELDS>
    <FIELD name="Global Field" refname="Namespace.GlobalField" type="String">
        <REQUIRED />
    </FIELD>
</FIELDS>
<GLOBALLISTS>
    <GLOBALLIST name="Years">
        <LISTITEM value="2014" />
        <LISTITEM value="2015" />
      </GLOBALLIST>
</GLOBALLISTS>  
</GLOBALWORKFLOW>
  1. I can import globalworkflow.xml either having only "Fields" tag or only "GlobalLists" tag but not both. If I try to import with both, like shown above, it gives a xml validation error indicating the second tag is not an acceptable child element of "GlobalWorkflow" tag.

    If I put "GlobalLists" second, "GlobalLists" is the invalid child element, "Fields" tag is invalid if it's written as second element.

  2. If it is imported including "Fields" tag, after import of global workflow; I can see the defined field in the WI Field Explorer of Power Tools but not in the definitions of the work items or in any combo for Field Selection, only in Work Item Field Explorer(not in Layout Tab, Workflow Tab or Fields Tab of work item).

MSDN vaguely explained the process like:

If you specify a field that is not currently defined for the team project or the collection, the field is created when the global workflow is imported.

I can assume, global workflow xml only saves the field and then you still have to define the same field in the fields tab of the work item to use it in Layout tab and Workflow tab. TFS only prevents another field creation in the same name and also implements the defined field rules. This logic, is not nice imho but still can be acceptable.

But there is still a problem with that logic to be true, because if I import global workflow with only globallist definitions, defined globallists are not seen in the global list designer screen or not in combo fields like "allowedvalues" rule options.

I'm using witadmin -importglobalworkflow /collection:"url" /f:"filepath" command and though I want my global workflow definition can be used from all my Team Project Collection

Expected Result I want to be able to import a global workflow with both "Fields" and "GlobalLists" elements and after import operation, in a work item I should be able to see these definitions like the way I've created using Power tools.

UPDATE: 1 is solved: one global workflow can not include both "fields" and "globallists" elements. MSDN didn't specifically explained it but the examples here include only seperate xml files.

1

1 Answers

1
votes

Separate the globalist into a separate file, and import it with the command

witadmin importgloballist /collection:"http://MyServer:8080/tfs/DefaultCollection" /f:Directory/globallist.xml

Reference for globalists here: http://msdn.microsoft.com/en-us/library/ms194977.aspx