0
votes

I just got a json file which was exported from a TFS (On Premises). Now i want to import it in VSTS, but i got the following error. enter image description here

It says Cannot read property 'length' of undefined

I also tried it using a extension. It is importing the file successfully and making variables but not making tasks.

Link of extension: Import/Export Build definition

2

2 Answers

0
votes

Generally export/import build definition works on the same version/level of TFS as they have the same properties.

In your scenario you are trying to import the build definition cross versions (On Premises and VSTS here). Since there are some differences between the On Premises TFS and VSTS, For example some tasks are only existing in VSTS, and some tasks are different...

So you cannot simply import the json file. Suggest you creating an equivalent build definition manually in VSTS. Then export and import to other team projects from VSTS.

1
votes

Actually, I think there is a bug in Azure DevOps. If I export a file, and then try to import the resulting JSON, I will get an error like so:

Cannot read property 'length' of undefined

EDIT I was able to successfully import the JSON export by adding a property to the JSON file. adding "options":[], to the root resolved the issue.
The next issues I had were that I was exporting from my account to a friend's account. So we had to update the azure URLs and GUIDs in the JSON file.