CCM Application work item attachments download
2 answers
Personally, I am not aware of any "bulk download" feature that allows a user to download all attachments from all work items of Project Area.
Anyway, it should be possible to achieve this goal programmatically.
Some time ago, I developed a server-side extension that was able to download an attachment from a work item during the "save" operation.
Maybe this code snippet can help (supposing you have already retrieved attachment and contentService):
IContentService contentService = ...;
IAttachment attachment = ...;
String attachmentsFolder = "C:\temp\attachments";
try {
String attachmentName = attachment.getName();
String attachmentPath = attachmentsFolder + "\" + attachmentName;
File save = new File(attachmentPath);
OutputStream out = new FileOutputStream(save);
try {
contentService.retrieveContent(attachment.getContent(), out);
} finally {
out.close();
}
} catch (FileNotFoundException e) {
// error handling
} catch (IOException e) {
// error handling
}
String attachmentsFolder = "C:\temp\attachments";
try {
String attachmentName = attachment.getName();
String attachmentPath = attachmentsFolder + "\" + attachmentName;
File save = new File(attachmentPath);
OutputStream out = new FileOutputStream(save);
try {
contentService.retrieveContent(attachment.getContent(), out);
} finally {
out.close();
}
} catch (FileNotFoundException e) {
// error handling
} catch (IOException e) {
// error handling
}
You could try to do the same with Plain Java API.
The work item command line supports downloading and storing attachments. See https://github.com/jazz-community/work-item-command-line#available-commands . E.g. exportworkitems can be used to export attachments for multiple items for a query.