4

For a particular Team Foundation Server Work Item when transitioning State from New to Active I would like to set the AssignedTo field to the current user. After looking at a few examples I came up with the below transition markup:

<TRANSITION from="New" to="Active">
  <REASONS>
    <DEFAULTREASON value="Implementation started" />
  </REASONS>
  <FIELDS>
    <FIELD refname="Microsoft.VSTS.Common.ActivatedBy">
      <ALLOWEXISTINGVALUE />
      <COPY from="currentuser" />
      <VALIDUSER />
      <REQUIRED />
    </FIELD>
    <FIELD refname="Microsoft.VSTS.Common.ActivatedDate">
      <SERVERDEFAULT from="clock" />
    </FIELD>
    <FIELD refname="System.AssignedTo">
      <DEFAULT from="currentuser" />
    </FIELD>
  </FIELDS>
</TRANSITION>

The above does set the AssignedTo field, but sadly sets it to the TFS Service Account and not the current user making the change.

What is wrong with my markup or server configuration that is causing the AssignedTo field to be set to the TFS Service Account and not the current user?

ahsteele
  • 26,243
  • 28
  • 134
  • 248
  • What's the result of the ActivatedBy? – PatrickLu-MSFT Jun 06 '16 at 13:21
  • @Patrick-MSFT it gets set to the TFS service account which is a domain account. I'm not sure if there is a proper name for the role the account plays in our TFS project collection, but it is definitely not the current user's account. Given the accounts role I am suspicious if it's acting as a proxy account (much like a database account in a connection string) and is actually making the change and is therefore masking the actual user. – ahsteele Jun 06 '16 at 13:32

1 Answers1

1

There is none error with your TRANSITION.

currentuser : Name of the user who is logged on. Use the short user name of the current user as the value. No additional attributes are required. Valid only for string fields.

Please double check the logged on user, make sure it's not the TFS Service Account

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Is there a simple way to determine the logged in user? The UI gives the impression that I'm logged in by showing my name throughout. – ahsteele Jun 06 '16 at 14:00
  • 1
    1) Go to control panel -> credential manager 2) under 'windows credentials' find row with your TFS server url 3) click remove / When your connect to tfs next time from VS, it requests credentials and you need enter actual login and password. More details refer to this link https://bhrnjica.net/2012/11/14/how-to-change-tfs-user-name-and-password-in-visual-studio-2012/ – PatrickLu-MSFT Jun 06 '16 at 15:05
  • 1
    I followed the directions in the linked post and sure enough my Windows Credential for our TFS site is set to the TFS service account. When I remove the account and reconnect to TFS via Visual Studio it adds the credential back. This is not occurring for other team members. I am going to work with my onsite TFS support team to see if we can determine what is going on. That said the transition is working correctly (when the appropriate user is authenticated). Thank you for helping start to get to the bottom of this. – ahsteele Jun 06 '16 at 19:17