cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

I can not get multiple Images with mks.api extractattachments command

MDK_JWKWON
6-Contributor

I can not get multiple Images with mks.api extractattachments command

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.

0 REPLIES 0
Top Tags