TFS 2017 vNext Build: Customize fields on bugs created on build failure - tfs

I am creating task-based builds in TFS 2017. The builds have an option (under the 'Options' tab) to create a Bug automatically when the build fails.
When the build fails and a Bug is created, the bug says it was created by me. I assume this is because I am the one who set up the build definition. However, I am not usually the person who kicks off the build, nor do I check in code for this project. I would like to change the default "Created By" value to either a team member who is responsible for fixing broken builds, or a generic value like "DevBuild".
The "Create Work Item on Failure" area has an "Additional fields" section that I wonder if I could use for this, but I'm having trouble working out if that's what it's for and how it might be used.
The help prompt reads:
Additional fields to set when creating the Work Item.
For example, "System.Title" = "Build $(build.buildNumber) failed" will
format the Work Item title, and "System.Reason" = "Build failure" will
set the reason.
So I tried this, but to no avail.
Is there an option for changing the Created By field? Is there a list of possible field values I could use here to change other parts of the bug?

Your setting is correct. Once you add System.CreatedBy field, the value of Created By field will be reset.
You could run a query and select Created By column to check the values:

Related

Get the list of Projects under selected solution in TFS Build definition

Is there any way by which i can get the number of projects under selected solution in my build definition.
I am creating a parameter of type Drop down List, which should be got filed by the number of projects (.csproj) the solution has.
I have to do this calculation before queuing the build, so that i can ask the user to select any of projects from list to deploy.
Can anybody tell me how can i do this in TFS Build template.
I don't think you can calculate the number of projects under a selected solution in Build Definition. Metadata about a process parameter contains a piece of information Editor, this is a string that specifies a custom editor for the parameter, there is not a method to calculate the number of projects under a selected solution in Build Definition. See the Editor Attribute help for more information on the syntax.

MSBuild error 1 has ended this build

I am trying to integrate Gulp in TFS builds and web deploy using the article given here as reference. When I build the solution using the command (Alt+B+R), an output directory gets successfully created by gulp. But, when I try to queue a new build by right-clicking my build definition, the build fails with the following error.
Can anyone help to get rid of this error?
According to the error TF42097: A work item could not be saved due to a filed error.
The build uses the Default Template (or a customization) and has the Create Work Item on Failure option turned on, however the Bug work item has been modified in a way that means the build is unable to create it – which could be as simple as making a field mandatory.
How you fix this depends on how the Bug work item has been restricted. Work item fields that have been made mandatory should have a value specified in the build process template, and if that value should vary depending on the build definition you will need to expose it as an argument in the definition.
A workaround for this situation:
Adding in a PropertyGroup <SkipWorkItemCreation>true</SkipWorkItemCreation> will stop it from attempting to create the work item.
A similar question from MSDN for you reference.

TFS Build Gated Check-In - Need to Select from Multiple Build Definitions

I got two build definition that is mapped to some common folders. When I do check in it prompts me the selection box to pick up either of the build definition.
It gives me the option. Can I change my build definition to select the default based on what is triggered and show it as the first option without need for user to select the right one?
If you have two build definitions configured for the same source control folder then you will always get a choice. There is no way to set a default.
It is recommended to have only one gated-checkin configured to avoid confusion.

TF285017: The Assigned To field cannot be blank

I'm working with TFS 2010 and Project 2010 Feature Integration pack and the Scrum for Team System v3 process template. Within the Project Server tab, I'm trying to set the default value for "Submit to Project Server" and "Enterprise Project" (which works fine), but when the Project Backlog Item is created/saved, it always fails when trying to sync with Project Server with the error message in the title of this post: TF285017: The Assigned To field cannot be blank.
I've Googled the error code, and it seems like there is no documentation for it anywhere. Can someone help?
Ultimately I fixed by adding the Assigned To field to the template and making it required. This probably isn't the best way to solve this issue, but does get around the error (and making the field required was something I was going to do anyway).
As the error states, in the TFS process template for the backlog item, the Assigned To field is mandatory. It needs to be filled before it can be synced with the other system.
You might try to remove the required flag from the Assigned To field in the workitem by using the TFS Power Tools process editor.

What causes TFS to create additional workspaces?

I've seen the question related to the error message you get from TFS when a workspace is already mapped. The accepted answer for removing the workspace is alright as a workaround, but it's already getting tedious to run a delete command each time this error occurs.
What do I need to change in order to get out of having to use this workaround? I've got two builds (continuous integration and nightly deploy), and need to add at least one more build type. I followed this URL to see if there was a possible resolution there, but I'm not sure I understand it completely.
I am not sure how this is accomplished in TFS 2010, as I have not gotten to work with Team Build in 2010, yet. In 2008, though, if you expand the Builds node in the Team Project and right-right click on either of the builds, you will see a "Manage Build Agents..." option. Click into that, and it will bring up a dialog. One of the things on that dialog is an option called "Working Directory". Do you have the same hard-coded path in both of them?
By default, when you create a new build definition, it provides a calculated folder for this value. This is where the build agent will do the checkout from TFS for the build attempt. The default value is, $(Temp)\$(BuildDefinitionPath), I believe (I am not connected to TFS at the moment).
The article you link to is basically saying that you should include either that $(BuildDefinitionPath) value or the $(BuildDefinitionID) value as part of that path in that dialog so that the two builds do not try to use the same workspace. Changing the working folder to include one of those values should resolve your issue, going forward.

Resources