OnRoad Test Management

Welcome to OnRoad Test Management Sign in | Join | Help
in Search

Change additional fields in TFS when synchronizing - how to?

Last post 08-05-2010 8:47 by ilpo. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 06-22-2010 16:59

    Change additional fields in TFS when synchronizing - how to?

    Hi,

    Consider this desired behavior when synchronizing from QC to TFS:

    The "State" field in TFS is modified so it now matches "Status" in QC. When "Status" changes in QC the value is transferred to "State" in TFS.

    To handle the workflow in TFS, a reason "Changed in QC" is added, but is not the default reason (to have the wanted behavior when users are changing the work items state in TFS).

    How do we set "Reason" to the value "Changed in QC" when QC Status field is changed and the defect gets synchronized to TFS?

    My thoughts were to use transitions, but is that the way to go? It seems like it is aimed at QC only?

    Some advice would be appreciated! :-)

    Kind regards,
    Carsten-S

    • Post Points: 35
  • 06-22-2010 19:11 In reply to

    • ilpo
    • Top 10 Contributor
      Male
    • Joined on 06-16-2006
    • Espoo, Finland
    • Points 51,934
    • Juvander Consulting

    Re: Change additional fields in TFS when synchronizing - how to?

    Did you check the valuemaps.xml.sample? You can map 1-to-2 and 2-to-1 values on that.

    //Ilpo

    • Post Points: 20
  • 06-23-2010 10:06 In reply to

    Re: Change additional fields in TFS when synchronizing - how to?

    Hi Ilpo,

    Well, I did check the section "Configuring Value Maps" in the Installation Guide, but I did not check the contents of the sample file (I thought the were identical). I now understand that is the road to follow.

    We're currently using version 2.1 - are there any changes in later versions that I should be aware of? I see the description in the Install Guide has changed...

    The description in the Install Guide - is that the full documentation? To me it looks like an fine example, but....

    Kind regards,
    Carsten-S

     

    • Post Points: 20
  • 06-23-2010 11:19 In reply to

    • ilpo
    • Top 10 Contributor
      Male
    • Joined on 06-16-2006
    • Espoo, Finland
    • Points 51,934
    • Juvander Consulting

    Re: Change additional fields in TFS when synchronizing - how to?

    I don't think that there is changes that really affect this feature.

    The way it works is using UpdateOtherField for 1-to-2 and CompareRule for 2-to-1 valuemap.

    //Ilpo

    • Post Points: 20
  • 07-06-2010 16:43 In reply to

    Re: Change additional fields in TFS when synchronizing - how to?

    Hi Ilpo

    I've changed the workflow for a Bug in TFS, so "State" in TFS matches "Status" in QC. The workflow requires "Reason" to be filled out. Therefore I created this valuemap (showing just the first entries):

    <ValueMap Name="QCStatustoTFSState">
      <
    Value MatchTypeValue="DefaultMatch" tfs="New" qc="New">
        <
    UpdateOtherField name="Reason" value="New"/>
      </
    Value>
      <
    Value MatchTypeValue="DefaultMatch" tfs="Closed" qc="Closed">
        <
    UpdateOtherField name="Reason" value="Changed in QC"/>
      </
    Value>
      <
    Value MatchTypeValue="DefaultMatch" tfs="Developertest" qc="Developertest">
        <
    UpdateOtherField name="Reason" value="Changed in QC"/>
      </
    Value>
    ...

    My intention: When the value in QC changes to e.g. "Closed", the Bug work item has its state changed to "Closed" and  the "Reason" field gets the value of "Changed in QC".

    Any mistakes so far?

    The fieldmapping goes like this (using Force Field Update to bypass the transition-rules in TFS):

    <FIELDMAPPING Name="FHFH-Sandbox">
      <
    FIELD VALUEMAPNAME="QCStatustoTFSState">
        <
    FIELDDATAMASTER>None</FIELDDATAMASTER>
        <
    HTMLFORMAT>False</HTMLFORMAT>
        <
    FIELDMETHOD>Always</FIELDMETHOD>
        <
    RESOLVEUSERNAME>False</RESOLVEUSERNAME>
        <
    TDFIELD>BG_STATUS</TDFIELD>
        <
    TDFIELDLABEL>Status</TDFIELDLABEL>
        <
    TFSFIELD>State</TFSFIELD>
        <
    DEFAULTVALUE />
        <
    FORCEFIELDUPDATE>True</FORCEFIELDUPDATE>
      </
    FIELD>

    However, the State gets changed, but the reason do not, and I fail to se any error messages in the log.

    Question no. 1: What can the reason for this be?

    Question no. 2: Where do I find the documentation describing the properties etc. for the valuemapping? I've only found examples so far??

    Kind regards,
    Carsten-S

    • Post Points: 20
  • 07-06-2010 17:40 In reply to

    • ilpo
    • Top 10 Contributor
      Male
    • Joined on 06-16-2006
    • Espoo, Finland
    • Points 51,934
    • Juvander Consulting

    Re: Change additional fields in TFS when synchronizing - how to?

    I think the issue here is the ForceFieldUpdate, other field is not using that. Made a note on that for next release to add that.

    Try with out this flag and see then. 

    //Ilpo

    • Post Points: 20
  • 07-07-2010 10:35 In reply to

    Re: Change additional fields in TFS when synchronizing - how to?

    Hi Ilpo

    If I remove the "ForceFieldUpdate" flag, the "Reason" field is updated, so you are right - there is an issue there.

    BUT - that means that it is not possible to bypass the workflow transitions in TFS. Am I right?

    If I in QC changes the Status in a manner that does not comply with the workflow in TFS, the whole synchronization fails with the message: "Field State does not have valid value, current value is ...".

    So what you are telling me is that what I aim at: Having a specific workflow in TFS, but not in QC - is not possible?

    Kind regards,
    Carsten-S

    • Post Points: 20
  • 07-07-2010 12:54 In reply to

    • ilpo
    • Top 10 Contributor
      Male
    • Joined on 06-16-2006
    • Espoo, Finland
    • Points 51,934
    • Juvander Consulting

    Re: Change additional fields in TFS when synchronizing - how to?

    For this other field update it is currently not possible, made a not on that so it will be there.

    But, you could modify your TFS workitem template so that for this synchronizer user these rules are not checked, only for all other users.

    Or then implement same rules on QC side.

    //Ilpo

    • Post Points: 5
  • 07-27-2010 17:49 In reply to

    Re: Change additional fields in TFS when synchronizing - how to?

     I am dealing with same exact issue. As we are also using AGILE Template and TFS State and Reason fields need to be selected in order for the Bugs to go thru their AGILE Workflow.

    I created two similar fields in QC 10; TFS State and TFS Reason.

    I am able to manipulate the Reason field drop down list depending what State Value is selected.

    However I am unable to make this action REQUIRED on QC side.

    I avoided coding the ValuesMap.XML as this caused more confusion between Development and Testing Team on how interpret 3 diff States and 13 Diff Reason into 6 or 7 QC Status Values.

    I would like to know how can I code QC Workflow so whenever I changes the State value , Reason value becomes Required for a Tester in QC.

    I know I need to add code in Bug_MOVETO and BUG_FEILDChange areas however with many tries I am unable to get this action set properly.

    We have also added a new TFS State = Active New , in order to differentiate between New Bug Active and Exisiting Bug being in Active New State.

    Extra Note :

    We also created a Mercury Created by field in order to capture who created the Bug in QC, as our TFS Admin didn't allowed TFSQCSync Account to be a part of TFS Service Accounts -group

    However this field is being mapped for TFSQCSynch from both sides, however it not getting update at all. 

    • Post Points: 20
  • 08-05-2010 8:47 In reply to

    • ilpo
    • Top 10 Contributor
      Male
    • Joined on 06-16-2006
    • Espoo, Finland
    • Points 51,934
    • Juvander Consulting

    Re: Change additional fields in TFS when synchronizing - how to?

    What kind of workflow code you added to your QC project?

    • Post Points: 5
Page 1 of 1 (10 items)