Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Create Version with API

As I check out a new branch in git, I would like to also create a new version in Matillion, as can be done by a) Pressing the green "Project" button in the GUI and then b) choose "Create Version" in the menu. Can this be done?

2 Community Answers

Matillion Agent  

Kalyan Arangam —

Hi Fredrik,

Here’s two API commands, one to export a specific version and then to import that file into a Project-Group and Project.

Export a specific version
curl -X GET -o mtln_project_version.json -u api-user:api-user “http://10.12.2.93/rest/v1/group/name/Development%20Projects/project/name/My%20Project/version/name/SomeVersion/export”

Project group – Development Projects
Project Name – My Project
Version name – SomeVersion

Import into a different project
curl -X POST -u api-user:api-user “http://10.12.2.93/rest/v1/group/name/Production%20Projects/project/name/Live%20Project/version/import” -H “Content-Type: application/json” —data-binary @mtln_project_version.json

Project group – Production Projects
Project Name – Live Project

Please note that the version-name is included in the JSON export. You may change the appropriate entries in JSON to rename the target version.

Hope that makes sense.

Best
Kalyan


Fredrik Edin —

Thank you!

This worked fine. I updated the version in the variable I called data, that I loaded from mtln_project_version.json, by setting data['objects'][0]['name'] = my_new_version_name before saving to mtln_project_version.json.

Post Your Community Answer

To add an answer please login