I am creating a workflow for Shared Drive (Team Drive) where I have 3 folders under team drive:
TO BE APPROVED
APPROVED
REJECTED
I am sending a document from TO BE APPROVED folder for approval, if user approves it then this document should move to APPROVED folder. Same logic for REJECTED.
Now my question is how can I move a document between Shared Drive folders. DriveApp.getFolderById(folderId).addFile()
is not working as I can not have more than one parent in Team Drive. DriveApp.getFolderById(folderId).createFile()
is working but it is creating a whole new file with new ID which is not fulfilling my purpose of approval workflow as this is a whole new file.
Is there any way to move file or copy/replace any operations which will not change my file's ID? I tried for REST APIs as well but couldn't found any.