Community Tip - You can change your system assigned username to something more personal in your community settings. X
Hello, I'm jinwoo.
Using PTC Java api, I want to extract (save) an images inserted into an item through the extract attachments command.
When saving an image, when multiple images are inserted into the Text Attachments column of an item, an error message is printed when the following code is applied:
I would like to ask you how to import multiple images in a command at once or one specific image within an item.
I must take one image from the "Text Attachments" column.
cmd = new Command(Command.IM, "extractattachments");
cmd.addOption(new Option("issue", workItem.getId())); // Item ID
cmd.addOption(new FileOption("outputFile", item.getId()));
mv = new MultiValue(",");
mv.add("Text Attachments");
cmd.addOption(new Option("field", mv));
res = getCmdRunner().execute(cmd);
res.release();
Error: Caused by: com.mks.api.response.InvalidCommandSelectionException: MKS978530: This command accepts a selection of exactly one attachment.
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
As a result, you want to implement the ability to export images to Excel.
Thank you.