Is there a way to change the Created By field on a work item in TFS? Maybe by altering the database?
I want to be able to create a bug/feature/PBI, then change it to be
You can only overwrite the CreatedBy field when create the workitem via API with bypass rule enabled. Refer to this link for details: Make an update bypassing rules.
A quick solution for this would be create a powershell script to create the workitem via Rest API. Sample for your reference:
#Input basic information
$collectionuri = "http://tfsserver:8080/tfs/DefaultCollection/"
$project = "ProjectName"
$workitemtype = 'Task'
$createdby = 'Display Name'
$title = 'Title'
#Create the workitem
$workitem = @(@{op="add";path="/fields/System.Title";value=$title},@{op="add";path="/fields/System.CreatedBy";value=$createdby})
$json = $workitem | ConvertTo-Json -Depth 100
$headers= @{"Content-Type"="application/json-patch+json"}
$url= $collectionuri + $project + '/_apis/wit/workitems/$' + $workitemtype +'?bypassRules=true&api-version=1.0'
$mycredentials = Get-Credential
$wi = Invoke-RestMethod -Uri $url -Method Patch -Credential $mycredentials -Body $json -ContentType 'application/json-patch+json'
Write-Host $wi