TFSFieldMapping Access is Denied - tfs

Hi I'm am trying to follow Microsoft's guidance to download the TFSFieldMapping file in order that I can make changes (https://learn.microsoft.com/en-us/azure/devops/reference/xml/upload-or-download-the-microsoft-project-mapping-file?view=tfs-2018)
Unfortunately I keep getting the error "Access is denied" when I try to connect to my collection and project
CD C:\Program Files\Common Files\microsoft shared\Team Foundation Server\16.0>TFSFieldMapping.exe download /collection:https://dev.azure.com/(My Company) /teamproject:(My Project)/mappingfile:"C:\Users\danie\Downloads\Test1234.xml"
"Access is denied"

That documentation appears to be for TFS (on-premise). Based on the URL, it looks like you are utilizing Azure DevOps Services. It seems to be a deprecated function, probably because of the way the field templates have been overhauled for work item forms.

Agree with Matt. TFSFieldMapping is only supports TFS 2018 and previous versions. Because their process is Hosted XML Process. Starting from Azure Devops Server 2019 and azure devops service, they use the inherited process. So they doesn't support the TFSFieldMapping.
From the URL in the TFSFieldMapping command, it seems that you are using the Azure Devops Service.
To change the Project field, you can create an inherited process and let the project use it. Then you can perform custom operations (e.g. Custom field) on the inherited process.
You could custom the field in Organization Settings -> Process.
Here is a doc about the detailed steps.
You could also use Rest API to Get and Update the field.
Get Work item field:
GET https://dev.azure.com/{organization}/{project}/_apis/wit/fields?api-version=5.1
Update Work item field:
PATCH https://dev.azure.com/{organization}/{project}/_apis/wit/fields/{fieldNameOrRefName}?api-version=4.1
Note: Corresponding to the inheritance process, you need to inherit first and then customize

Related

Azure DevOps secure file guids

In my ADO build pipline, I have a secure file download step. When we branch versions, we use powershell to do the heavy lifting with cloning build definitions and updating settings/info in the cloned pipeline.
One issue I've run into is that the Secure File Download step doesn't accept variables, and in the UI you can only select names of files that already exist, so we've had to manually update it after every new branch we create.
I've grabbed the definition task step in powershell (as $step) and was hoping I could set the $step.inputs.fileInputs to a variable I assign to something like cert-$newVersion, however it currently is set to a guid.
Does anyone know if it possible to get the guid of secure files in ADO via the API or have a solution?
Does anyone know if it possible to get the guid of secure files in ADO via the API or have a solution?
Yes. This API exists.
You could try to use the following Rest API:
Get https://dev.azure.com/{OrganizationName}/{ProjectName}/_apis/distributedtask/securefiles?api-version=6.1-preview.1
Result:
You could get the secure file GUID based on the file name.

how to add a work item to an existing workflow at an Azure DevOps Server project?

I just install a new copy of Azure DevOps Server (TFS) to my own computer.
the only work items I can use right now are: "Epic", "Issue" & "Task".
Now my Question is:
How can I add the work items "User Story", "feature"& "Bug"?
Thanks any help will be appreciated.
Because when you created the team project you chose Basic process template, you need to choose Agile/Scrum/CMMI.
Try to create a new project with Agile/Scrum/CMMI process template.
See here more info.
Agree with Shayki Abramczyk.
How can I add the work items "User Story", "feature"& "Bug"?
We could create work item via Agile process, then we could add work items User Story, Feature and Bug.
If you still want to use Basic Process template and your TFS version is Azure DevOps Server 2019 or later versions. You could create collection via Inheritance process model, then open Collection Settings->Process->select Inheritance process->click the button New work item type to add new work item type.
If you are using On-premises XML process model, you could refer to this doc to add work item type.

Change TFS email template

Can I change the email template used by this TFS 2017 feature?
There's a folder under the TFS installation that hosts the templates for the eventing services alerts. You need to modify the xsl file corresponding to your event (in this case WorkItemChangedEvent.xsl) to change the formatting.
You can find this templates under Drive:\%programfiles%\Microsoft Team Foundation Server 15.0\Application Tier\TFSJobAgent\Transforms\1033 and after you modify it, you need to restart the application pool or the website because the templates are cached when the site starts.
P.S. Be sure to backup the original template and the changed one, because in future service packs or hotfixes Microsoft can replace this template and you'll loose your changes.
More info you can find here.

Change credentials per server?

I've installed opshub on my pc that is on domain ABC. I have succesfully migrated projects from a TFS server on domain ABC to visual studio online. Now I've added a TFS server that is in domain DEF and it doesn't ask me for credentials for that server. I just get a blank collection list, I think its trying to use my current credentials from domain ABC. How can I get it to ask me for the credentials to domain DEF when trying to access that server?
User level authentication details are stored inside Team Foundation cache directory under following locations. If you have already authenticated for the TFS server then details for that server is stored inside cache directory. This won't ask you credentials again while you are doing next migration.
If you want to authenticate with the new credentials for different domain you need to clear data from the following directories.
C:\Users{User}\AppData\Local\Microsoft\Team Foundation\4.0\Cache
C:\Users{User}\AppData\Local\Microsoft\Team Foundation\5.0\Cache
Make sure original folders remains there (Cache). Just remove contents of those directories. Also make sure you close all the applications which uses TFS cache like visual studio, opshub migration utility.
See http://blogs.msdn.com/b/visualstudioalm/archive/2012/08/29/clearing-the-credentials-for-connecting-to-a-team-foundation-server.aspx for correct answer. It worked for me.

Teamcity setup with Visual Studio Team Services

I have been trying to integrate Team city with Visual Studio Team Services and keep getting this error, can anyone help.
I have enabled basic authentication in tfs by going to
TFS -> Profile -> basic authentication.
Trying to create a Create Project From URL on TeamCity, Getting error on below setting.
Settings
Repository URL: * https://xxxxxx.visualstudio.com/DefaultCollection/AddBk
Error
Could not create a project by specified URL, URL is not recognized
You need to specify the repository as including the collection but not the project.
So http://mytfs.visualstudio.com/defaultcollection as the repository and then you can specify the $/myTeamProject/[path] in the "root" variable.
http://confluence.jetbrains.com/display/TCD8/Team+Foundation+Server
For credentials I would recommend that you use the server account credentials rather than local user ones. You can get the server credentials through the API or by using the TFS Credential Viewer.

Resources