Post

1 follower Follow
1
Avatar

clone an item and its related tasks

Hi there,

I'm a bit stuck on creating a tool that let's us clone an item together with all its tasks.
So that you know -> I'm working with the ruby library, and I'm new in the language, so I excuse in advance for some rookie questions..

I'll describe the different steps I think I need to go through and my problems..

Step 1: authenfication, I thaught auth as app would work but I guess it will have to be as user. Because some API calls are not working as expected (doing nothing or return empty arrays). -> Question: On first sight, which auth do you think I need seeing my very basic requirements?

Step 2: clone the item: using
item = Podio::Item.find( item_id )
item.clone
returns a NoMethodError
//-- or --
Podio::Item.clone( item_id )
returns ArgumentError, wrong number of arguments (1 for 0)

Question -> how to do this?

Step 3: copy the tasks, so far as I understand is there no specific API call for cloning tasks. So I guess I have to read out all of the tasks for an item and then add them one by one.
However, when using Podio::Item.find( item_id ) it retursn me the item, but the tasks array is empty while it does have tasks in the system. Is this due to auth? Also when I want to use tasks = Podio::Task.find_all( {'item_id' => item_id } ) I get an error because for that API call, user auth is required which I preferably don't use..

Any help on the 3 steps?
Thanks

Piet Muller

Please sign in to leave a comment.