It's all about the answers!

Ask a question

when a workitem is deleted, does its attachments get deleted too (if it was the last attachment referencer)?

sam detweiler (12.5k6195201) | asked Feb 17 '14, 5:11 p.m.
we have been testing our project copy utilities, one run on our production machine for timing estimates..
we will delete all the workitems and do a new run on the final cutover..

but I realize now that we created a lot of attachments that need to be redone too..
how to clean them up is the issue.. any ideas? query all workitems with attachments, then process the list and delete them one by one?

thanks for any guidance..

Accepted answer

permanent link
Ralph Schoon (63.2k33646) | answered Feb 18 '14, 7:19 a.m.
Sam, I just looked into the workitemDelete API and it looks like attachments are deleted only, if they are not referenced by another work item.
sam detweiler selected this answer as the correct answer

sam detweiler commented Feb 18 '14, 7:38 a.m. | edited Feb 18 '14, 7:38 a.m.

thanks.. of course I didn't think of looking at the code!.. doah!

now, I think I WILL go look, as our utility had a bug,.  the links created for attachments were backwards..  the attachment referenced the workitem, not the other way around..

everything looked great on the web, but there were NO attachments when using Eclipse (for a specific workitem)..   wonder how the delete logic handled that!..

we are deleting ALL workitems in a project.  

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.