Required tfs fields

Clark January 23, 2013

When defining fields for the work item synchronizer, I have several fields that don't have a JIRA equivalent and therefore has no jiraName.

I have set defaultIfNull to true, and the defaultValueJiraToTfs to an appropriate value.

The configuration utility complains of no jiraName (because I have multiple required fields defined similarly).

I have been unsuccessful in creating a TFS work item.

What am I missing?

Here is my config:

<?xml version="1.0" encoding="utf-8"?>
<UseTfsWorkSynchronizer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <useTfsFields>
    <UseTfsField>
      <tfsName>System.WorkItemType</tfsName>
      <jiraName />
      <limitSynchToDirection>None</limitSynchToDirection>
      <defaultValueJiraToTfs>Feature Team Issue</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>System.Title</tfsName>
      <jiraName>summary</jiraName>
      <limitSynchToDirection>Both</limitSynchToDirection>
      <defaultValueTfsToJira>HSPSTFS</defaultValueTfsToJira>
      <defaultValueJiraToTfs>JIRA -</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>Jira.IssueKey</tfsName>
      <jiraName>key</jiraName>
      <limitSynchToDirection>Jira2Tfs</limitSynchToDirection>
      <defaultValueJiraToTfs>JIRAxFer</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>System.Description</tfsName>
      <jiraName>description</jiraName>
      <limitSynchToDirection>Both</limitSynchToDirection>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>false</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>myCompany.FeatureTeam.IssueType</tfsName>
      <jiraName />
      <limitSynchToDirection>None</limitSynchToDirection>
      <defaultValueJiraToTfs>SCR</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>myCompany.FeatureTeam.Product</tfsName>
      <jiraName />
      <limitSynchToDirection>None</limitSynchToDirection>
      <defaultValueJiraToTfs>Online PM</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
    <UseTfsField>
      <tfsName>myCompany.FeatureTeam.TargetVersion</tfsName>
      <jiraName />
      <limitSynchToDirection>None</limitSynchToDirection>
      <defaultValueJiraToTfs>[Next]</defaultValueJiraToTfs>
      <mappingValuesTfsToJira />
      <mappingValuesJiraToTfs />
      <defaultIfNull>true</defaultIfNull>
      <fieldDataType>TEXT</fieldDataType>
    </UseTfsField>
  </useTfsFields>
  <name>Jira Bugs XFER</name>
  <wiqlQuery>SELECT [myCompany.FeatureTeam.TargetVersion],  [myCompany.FeatureTeam.IssueType], [myCompany.FeatureTeam.Product], [System.Id], [System.WorkItemType], [System.Title], [System.State], [Jira.IssueKey], [System.Description], [System.ChangedDate] FROM WorkItems WHERE [System.ChangedDate] &gt; '%2$s' AND [System.Id] &gt;= '%1$s' ORDER BY [System.ChangedDate] ASC </wiqlQuery>
  <jqlQuery>key = %1$s AND type = 'Bug'</jqlQuery>
  <entityId>-1</entityId>
  <synchronizeAttachments>None</synchronizeAttachments>
  <synchronizeComments>Both</synchronizeComments>
</UseTfsWorkSynchronizer>

 

 

1 answer

1 accepted

1 vote
Answer accepted
Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 23, 2013

If you have fields that have no equivalent just don't add them to XML - the <useTfsFields> section should only contain fields that are going to be replicated.

If they're "static" values then you don't need to put anything in jiraName (you might be prompted to verify that but it should work anyway. Then set the synchronization direction properly. I see you have mixed <limitSynchToDirection> values, especially the ones with 'None' make me wonder - if you've set only <tfsName> and <defaultValueJiraToTfs> then I guess your synch direction should be 'Jira2Tfs' if you want that default value to appear in TFS.

Note: do not synch 'Jira.IssueKey' - it's automatically filed by UseTFS.

Have you looked at the work synchronizer sample XML file in client app directory ( default: C:\Program Files (x86)\UseTFS )?

Clark January 24, 2013

I've taken your suggestions and still am unsuccessful.

Clark January 24, 2013

Is there a way to see the 'packet' communication between useTFS and TFS (or vice versa) or processing logs? Or, any logging as to whether it works or doesn't?

The logs I have found so far are not helpful (.\useTFS\currentlog.txt, and the atlassian logs). Logging level is set to "all".

Andrzej Pasterczyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2013

You can "hack" UseTFS to enable debug logging (but take caution - they eat up HDD space quickly). In order to do that:

  1. Download UseTFS jar from Atlassian Marketplace
  2. Rename to zip and open in some archive manager (e.g. WinRAR)
  3. Modify log4j.properties and log4j-tfs.properties by replacing "log4j.rootLogger=OFF" with "log4j.rootLogger=DEBUG,R"
    You can also change file locations under "log4j.appender.R.File=C:/usetfs-jira.log"
  4. Make sure that files in archive are correctly modified
  5. Rename back to jar
  6. Upload to JIRA

If you need more help feel free to contact me via email: andrzej.pasterczyk@pigsty.com.pl

Suggest an answer

Log in or Sign up to answer