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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

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

mhyang
10-Marble

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

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?

ACCEPTED SOLUTION

Accepted Solutions
awalsh
17-Peridot
(To:mhyang)

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

 

View solution in original post

2 REPLIES 2
awalsh
17-Peridot
(To:mhyang)

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

 

mhyang
10-Marble
(To:awalsh)

Thank you! That works for me.

Announcements


Top Tags