Skip to main content
1-Visitor
July 30, 2018
Solved

URL for Item attachments?

 

Hi,

I have a series of scripts which interact with Integrity using the CLI via. Python subprocessing.

I can easily extract information relating to a particular item with

im viewissue

and then use Python to parse the output and extract the information I want.

 

What I would like to do is generate a list of URLs for the attachments associated with each item. 

I am aware of 

im extractattachments

but this actually downloads the files from the server. The issue with extractattachements, is that I plan to process many items, each with multiple attachments. Of these, the user may be interested in only a handful, so downloading them all would be wasteful. I would like to present the user with the links, which they can click to download the files if they choose. 

 

Is this approach possible? A compromise would be a link which opened up the item in the Integrity GUI (or web client) on the attachments tab?

 

Thanks in advance

Will

 

18-Opal
July 31, 2018

Since you are parsing the output of im viewissue, adding the option --showAttachments will add a list of all attachments to the CLI output.

Once you extract the names you can simply generate links to each of the individual attachments via the pattern http://<servername>:<port>/im/viewattachment?issue=<item id>&attachment=<attachment name>

4 replies

18-Opal
July 31, 2018

Since you are parsing the output of im viewissue, adding the option --showAttachments will add a list of all attachments to the CLI output.

Once you extract the names you can simply generate links to each of the individual attachments via the pattern http://<servername>:<port>/im/viewattachment?issue=<item id>&attachment=<attachment name>

Translate
wstokes1-VisitorAuthor
1-Visitor
July 31, 2018

@pmaechtlen,

 

Cool thanks this is what I was looking for! I could already get the attachment names from 'im viewissue' but I wasn't sure about how to construct the correct pattern to actually form a link to that attachment. Your solution worked great!

 

One point to note: 

im viewattachment

does not show up when I type

im --usage

at the console. Is it undocumented? 

Translate
18-Opal
July 31, 2018

This is correct, im viewattachment does not exist as a CLI command.

This is exclusive to the web-access URL schema.

Translate