cancel
Showing results for 
Search instead for 
Did you mean: 

Creating files in a different organization

Henchway
Contributor

Hi everyone,

i’m having the following challenge: I’m documenting files on Gitlab which are at some point then promoted from the Dev organization to the Prod org. This promotion runs in the Dev organization.

It turns out that the File Writer cannot write between the origanizations (between projects even according to the documentation) even though it does not throw an error. The file writer snap says that it has overwritten the files, but in the Prod instance the files don’t show up.

grafik

The file content is retrieved from gitlab in base64 encoding, which is decoded and then the file is created with the File writer. It works properly when staying in one organization.

grafik

Does anyone have a suggestion on how to create files in a different organization?

Best regards
Thomas

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@Spiro_Taleski - you are correct - you cannot create a file in a different org directly.

However, you could create a pipeline with a triggered task that is located in the target org that simply has a formatter (ex: CSV Formatter) and file writer snap. Then call that triggered task from your source org using a REST POST snap, pushing the file contents.

The Project Migration API will also move files between orgs with a REST call.

View solution in original post

5 REPLIES 5

Henchway
Contributor

Looks like it really just uses the local context.

grafik

Just verified that when staying within the same Org, it works as intended. However i couldn’t figure out how to leave the org boundaries yet.

@Henchway

I am not sure that with the file writer you can create a files across different organizations.

If you want to move/migrate the files(or any other assets like pipelines, tasks, accounts) to another Org, then you can use the Project Migration API:

https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1982373/Project+Migration+API

Regards,
Spiro Taleski

koryknick
Employee
Employee

@Spiro_Taleski - you are correct - you cannot create a file in a different org directly.

However, you could create a pipeline with a triggered task that is located in the target org that simply has a formatter (ex: CSV Formatter) and file writer snap. Then call that triggered task from your source org using a REST POST snap, pushing the file contents.

The Project Migration API will also move files between orgs with a REST call.

I’ve tested both yours and Spiros suggestion, i ended up having a pipeline in Prod, which takes care of the file creation for me, as i don’t just want to push over all files i have in the project, but only those files which were committed to git.

Thanks and best regards
Thomas