Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
Solved! Go to Solution.
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>
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>
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?
This is correct, im viewattachment does not exist as a CLI command.
This is exclusive to the web-access URL schema.
OK, that is interesting.
Are there many notable differences between the documented CLI commands and the web only commands? I find the general documentation on this to not be great, but perhaps I not always looking in the correct places.
If you have any helpful links that would be greatly appreciated - especially for the web-related commands.
Will