Required tfs fields

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] > '%2$s' AND [System.Id] >= '%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

Accepted Answer
1 vote

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 )?

I've taken your suggestions and still am unsuccessful.

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".

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
Community showcase
Posted Oct 16, 2018 in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

78 views 0 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you