-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trashed (orphaned) items batch processing #154
Comments
I've recently run into the same 500 error when adding 500+ items to a team via item-set option on one of our systems. I wasn't able to reproduce it in the development environment, so I don't have a fix yet. My plan is to replace that interface with some better mass add options. In the meantime, I'll implement the create endpoint for the API. Should be available some time in the next day or so. |
Thank you Alex for the quick reply. As a very bad and last solution I was investigating the possibility to directly create a SQL request... I'll try tomorrow to split my orphaned items into small item sets to process them. If you have any other idea/tips, please tell me 😉 |
I can probably push out the For the create, you'll just need to send a post request to /api/team-resource with global admin credentials. Then, for the payload, it expects a JSON with "team" as one key and team id as its value, and "resource" as another key and the resource id as the value. |
I've only tested this with a single example (and haven't tested all of the cases where if should produce permission denied), but if you are in a time crunch you should be able to temporarily checkout the api-create-team-reasource branch and set up a script to make api calls for each of the team resources you need to create. Otherwise, I might have the batch create api feature ready by the end of the day in your time zone tomorrow. Also, if your script uses the REST api to create items, you can pass team information with the other item data to add it to a team at the time of creation (this is already possible on the main branch). Just pass the key "team" or "add_team" with an array of team ids for the value. So, an example would look like:
|
good ! thank you for that branch ! It's not the perfect solution as I had to bypass some checks (e.g. compliance toward a template) to have it working. |
It needs to be a POST request, not PUT. It is POST because you are creating new "team resource" entities via the /team-resource endpoint, not editing a team. Glad the other route worked out for you! |
using teams 4.0.1
I ran a script and generated 1000 orphaned items (in an item set)
Question 1
Is there a way to create an item in a team via the API ?
If not (my case),
I try to move these items to the team "manually" (through the admin GUI)
Issue 1
In the trash, the batch action for orphaned items doesn't run anything. Nothing append, no log. nothing. Just the page is reloaded. Even with only 1 item (or few) is selected to be processed.
Issue 2
The other option would be to move/link the content of the item-set (with my orphaned items) to the target team. But I get error 500.
Processing them one by one is working well,
but this is not an option.
Any idea?
The text was updated successfully, but these errors were encountered: