Skip to main content
1-Visitor
March 6, 2018
Solved

getting detail information about attachments(Attachments, Shared Attachments, Text Attachments)

  • March 6, 2018
  • 1 reply
  • 2337 views

I know that getting detail information from a issue(Item) is

 

in CLI

$ im view issue 2

 

in Java API

Command cmd = new Command(Command.IM, "viewissue");
cmd.addSelection("2");

 

In result, I get the fields of the issue(item) that I selected.

Shared Attachments:
shared.txt

Text Attachments:
text.txt

Attachments:
attach.txt

Not just names of the attachments, I want to know the detailed information of for each attachments (text.txt, attach.txt, share.txt...) such as created by and created time.

I know that the detailed information of each attachments is shown in the GUI client when view detail of the item.

 

How can I retrieve those information by CLI and Java API?

Best answer by awalsh

Try using the option "showAttachmentDetails".

 

On the CLI, the output is like:

MKSImg8987741183544506197.png (5567 bytes) awalsh 2-May-2016 9:58:41 PM Attachment added automatically by rich content image/png bfecae030292b268a8f54c9d67454ebe

In the API, you will get:

 Field:
 Name = Text Attachments
 Data Type = mksItemList
 ItemList:
 Item:
 Id = MKSImg8987741183544506197.png
 Context = 2892
 Model Type = im.Attachment
 Field:
 Name = FileName
 Data Type = wchar_t *
 Value = MKSImg8987741183544506197.png
 Field:
 Name = FileSize
 Data Type = int
 Value = 5567
 Field:
 Name = CreatedBy
 Data Type = wchar_t *
 Value = awalsh
 Field:
 Name = DateAdded
 Data Type = wchar_t *
 Value = 2-May-2016 3:58:41 PM
 Field:
 Name = Summary
 Data Type = wchar_t *
 Value = Attachment added automatically by rich content
 Field:
 Name = ContentType
 Data Type = wchar_t *
 Value = image/png
 Field:
 Name = Checksum
 Data Type = wchar_t *
 Value = bfecae030292b268a8f54c9d67454ebe
 Field:
 Name = AttachmentID
 Data Type = int
 Value = 46

 

1 reply

awalsh5-Regular MemberAnswer
5-Regular Member
March 6, 2018

Try using the option "showAttachmentDetails".

 

On the CLI, the output is like:

MKSImg8987741183544506197.png (5567 bytes) awalsh 2-May-2016 9:58:41 PM Attachment added automatically by rich content image/png bfecae030292b268a8f54c9d67454ebe

In the API, you will get:

 Field:
 Name = Text Attachments
 Data Type = mksItemList
 ItemList:
 Item:
 Id = MKSImg8987741183544506197.png
 Context = 2892
 Model Type = im.Attachment
 Field:
 Name = FileName
 Data Type = wchar_t *
 Value = MKSImg8987741183544506197.png
 Field:
 Name = FileSize
 Data Type = int
 Value = 5567
 Field:
 Name = CreatedBy
 Data Type = wchar_t *
 Value = awalsh
 Field:
 Name = DateAdded
 Data Type = wchar_t *
 Value = 2-May-2016 3:58:41 PM
 Field:
 Name = Summary
 Data Type = wchar_t *
 Value = Attachment added automatically by rich content
 Field:
 Name = ContentType
 Data Type = wchar_t *
 Value = image/png
 Field:
 Name = Checksum
 Data Type = wchar_t *
 Value = bfecae030292b268a8f54c9d67454ebe
 Field:
 Name = AttachmentID
 Data Type = int
 Value = 46

 

mhyang1-VisitorAuthor
1-Visitor
March 7, 2018

Thank you! That works for me.