OnRoad Test Management

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

Issue with State field in ValueMap

Last post 03-01-2010 20:14 by brthomas. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 02-26-2010 17:29

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Issue with State field in ValueMap

    I am trying to start simple and do a one-to-one field mapping for the State field. After I get that working, I will add in the extra logic to update the related fields in TFS.  But, I cannot get the simple version working.  Here is my error:

    2010-02-26 10:07:19,076 DEBUG JuvanderTFS.TfsConnection (:0) - Field has value map defined: StateStatusQCtoTFS
    2010-02-26 10:07:19,077 DEBUG DataLibrary.ValueMapsClass (:0) - ValueMapping found, changing 'Assigned'->'Active'
    2010-02-26 10:07:19,078 INFO  JuvanderTFS.TfsConnection (:0) - Invalid value 'Active' for field 'State' using default value 'Active' instead

    Here is my ValueMap:

    <ValueMap Name="StateStatusQCtoTFS">
        <Value MatchTypeValue="DefaultMatch" qc="Assigned" tfs="Active"></Value>
        <Value MatchTypeValue="DefaultMatch" qc="Closed" tfs="Closed"></Value>
        <Value MatchTypeValue="DefaultMatch" qc="Deferred" tfs="Closed"></Value>
        <Value MatchTypeValue="DefaultMatch" qc="Failed" tfs="Active"></Value>
        <Value MatchTypeValue="DefaultMatch" qc="Fixed" tfs="Closed"></Value>
      </ValueMap>

    It fails for any QC value and always uses the default of 'Active'

    • Post Points: 35
  • 02-26-2010 17:35 In reply to

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

    Re: Issue with State field in ValueMap

    Are you creating new workitem in here?

    Try adding two State field maps, one with OnNew and one with OnUpdate field methods.

    You need to create new workitems with correct State, usually on TFS this is New.

    For more info, see here http://onroad.juvander.fi/Community/forums/p/654/2060.aspx#2060

     //Ilpo

    • Post Points: 20
  • 02-26-2010 17:43 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    I have the scenario where I am importing already closed bugs into TFS.  Will that not work because TFS requires it to be "Active" for a new item?  That doesn't make compete sense because I tried with a field of "Assigned" in QC.  It found the TFS "Active" mapping, but would take even that.

    Am I missing something?

    • Post Points: 20
  • 02-26-2010 17:52 In reply to

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

    Re: Issue with State field in ValueMap

    So you have modified your TFS workitem template so that 'Active' is valid State value for new workitems?

    For State field, you could put it using Force Field Update flag selected. If you have done installation guide Step 5 for your account that you are using to connected to TFS. This requires special permissions for the account in use.

    Using this flag you can bypass TFS transition rules.

    Also, you might add this field map twice with OnNew, once without Force Field Update, default value set to default State value you need to use and without QC field selected. Then add it second time, OnNew, Force Field Update selected and with QC field.

    Then what's going to happen is that it first updates your correct value for new item and then updates it to value passed from QC.

    Third line could then also be with field method OnUpdate to get next updates to be done correctly.

    //Ilpo

    • Post Points: 20
  • 02-26-2010 17:56 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    I have not modified the template.  For Bugs (which is what I'm dealing with - no requirements), the valid default states are Active, Resolved and Closed.

    • Post Points: 20
  • 02-26-2010 18:04 In reply to

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

    Re: Issue with State field in ValueMap

    Try manually creating one Bug workitem and verify this. Normal TFS workitem State value is New when creating an item.

    //Ilpo

    • Post Points: 20
  • 02-26-2010 18:11 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    Just verified it.  State is Active. Reason is New.  I am trying to set State field.

    • Post Points: 20
  • 02-26-2010 18:15 In reply to

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

    Re: Issue with State field in ValueMap

    Did you have correct workitem type selected?

    With this "Invalid value 'Active' for field 'State' using default value 'Active' instead" it says that 'Active' is not valid value for State field and it is trying to use default value 'Active' you have specified in field map and fails in that as well.

    So this could indicate that you have now different workitem type selected, it is logging the one it is using in the log file.

    //Ilpo

    • Post Points: 20
  • 02-26-2010 18:20 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    It will actually create the Bug work item type in TFS with the state of Active, but it's just the ValueMap lookup that is failing.  I was confused that the value "Active" from the ValueMap fails, but the default "Active" works.

    • Post Points: 20
  • 02-26-2010 18:24 In reply to

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

    Re: Issue with State field in ValueMap

    So are you saying that after the log entry there is no exception from it?

    //Ilpo

    • Post Points: 20
  • 02-26-2010 18:28 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    Correct.  It just does not have the right state in the newly created bug work item.  It always has "Active".

    • Post Points: 20
  • 02-26-2010 18:40 In reply to

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

    Re: Issue with State field in ValueMap

    Ok. Log level for that entry is anyhow just info, so all those that are with error level need to be solved.

    //Ilpo

    • Post Points: 20
  • 02-26-2010 18:45 In reply to

    • dtjensen
    • Top 25 Contributor
    • Joined on 02-23-2010
    • Points 380

    Re: Issue with State field in ValueMap

    This is completely beside the point.  The point is:  What do I need to do to resolve that state not being set correctly to the value coming from QC?  Keep in mind that "Active" from the ValueMap does not work, but "Active" from the default value DOES work.  So, what is wrong with my value map?

    • Post Points: 20
  • 02-26-2010 18:53 In reply to

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

    Re: Issue with State field in ValueMap

    Send the whole YapWatcher log where this is, it might tell a bit more to me than just this piece.

    //Ilpo

    • Post Points: 5
  • 03-01-2010 20:14 In reply to

    • brthomas
    • Top 50 Contributor
    • Joined on 04-14-2009
    • Sunny Obamalot
    • Points 115

    Re: Issue with State field in ValueMap

    You need different value maps from QC to TFS it would look like

     <Value MatchTypeValue="DefaultMatch" tfs="Active" qc="Rejected">
          <UpdateOtherField name="Reason" value="Resolution Denied"/>
        </Value>

    TFS to QC should look like

        <Value MatchTypeValue="DefaultMatch" tfs="Active" qc="New">
          <CompareRule name="Reason" operator="Equal" value="New"/>
        </Value>

    TFS requires a state and reason when you move from one to the other. I dont think even if you have one reason and make it default it will work.

    Basically the top one says if you set the defect to Rejected in QC then the corresponding item in TFS is set to Active/Res Denied

    Bottom says new items make new item in QC I could set it to say Active reason equals Res Denied that would make QC item change to Rejected.

        <Value MatchTypeValue="DefaultMatch" tfs="Active" qc="Rejected">
          <CompareRule name="Reason" operator="Equal" value="Resolution Denied"/>
        </Value>

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