61

In VSTS attachment can be uploaded for workitems. Those attachments are displayed in a seperate tab.

enter image description here

I found no way to reference those attachments from within the description of the workitems.

enter image description here

So how to do it?

Postlagerkarte
  • 6,600
  • 5
  • 33
  • 52
  • 1
    Just hit the same issue. You can get it by hitting F12, then Network, then click on the link and see what URL appears here (in Edge you can copy it). Hard work for something that should be simple! – BlueChippy Jul 23 '18 at 22:36
  • 1
    This is really fascinating that this is not implemented. Oh, boy! F12 did not work for me. – cuh Nov 11 '20 at 17:40
  • 4 years later this still not solved. One solution is to use chrome extension like Link Grabber for fast link retrieval instead of having to delve into Dev Tools – lww Jan 26 '22 at 14:55
  • i can't believe but I miss JIRA; this is too simple a task to involve such heartburn – Akber Iqbal Jul 10 '23 at 06:45

6 Answers6

31
  • drag and drop the attachment to your browsers URL text field
  • (optional:) remove the &download=true&api-version=5.0-preview.2 part at the end
  • use this URL to create a link in your comment
rtrrtr
  • 563
  • 5
  • 7
  • 1
    This should be the topmost voted answer (_even though some other answers are helpful_), as it gives the least number of steps required to retrieve the URL -- just drag the item to the address bar! I would argue there's hardly any need to edit out the query string from the produced URL. – Olúwátóósìn Anímáṣahun Jun 01 '22 at 13:01
  • 1
    A nice answer. One addition: You can drag + drop to your text editor (e.g. Notepad++). URL text field didn't work for me. – Matt Jul 22 '22 at 11:46
  • P.S.: For "Test Case Steps" you cannot insert a link directly. But you can create a link via MS Word and copy and paste it into the "Action" or "Expected result" field of ADO. – rtrrtr Feb 17 '23 at 11:18
13

I did not find another way yet and maybe it is not so logical :). But as workaround you may download an attachment from work item. Then you may copy a download link from your browser download page and use it on description field.

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31
6

A workaround that I found to this which shows a selected text within the comment as clickable and opens the attachment if you click on it is:

  1. find and copy the attachment url from browser Developer Tools,
  2. select the part of the text in Discussion box that you like to link to the attachment to,
  3. paste the attachment url to Address box in Create Link popup. You can get to this by using three dots (...) in Discussion section toolbox (More Tools) and select Create Link which allows you to paste the address.
SouthSun
  • 79
  • 1
  • 3
  • 3
    Apparently that's the only viable way to do that. And that's insane, given that VSTS/DevOps is an Enterprise platform. – ifthenelse Jun 22 '21 at 10:18
6

This is amazing that AzureDevops does not have this ability. It's disappointing and makes working with the product so much more difficult. I really cannot imagine how they use this product internally.

You could inspect the attachment url in chromedev tools, then copy the url, the element will look like

<div class="grid-cell-contents-container">
<span class="attachment-icon bowtie-icon bowtie-file-content"></span>
<a href="/link.filetype&amp;download=true&amp;api-version=5.0-preview.2" tabindex="-1">filename.filetype</a>

Then just remove the &amp;api-version=5.0-preview.2 part at the end

Come on Microsoft! You're better than this.

user2965205
  • 141
  • 2
  • 7
4

This would appear to be the least "hacky" way, as it relies entirely on the Azure DevOps UI:

  1. Go to the attachments list of the work item.
  2. While you hover over an attachment, three vertical dots with tooltip "More actions" will be shown: menu button
    from where you can open a submenu: dropdown menu
  3. In there, click "Copy attachment link".
  4. If you paste this link to a text-only context, you will get only the attachment filename, but if you paste it into a rich-text editor with support for links, such as the Description field or Discussion comments in the work item, the attachment filename will appear as a clickable link.
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
1

It is now possible maybe. Goto attachments and click on list view List view of attachments of a workitem

Then just left-click on the file of your choice and drag it

  • I could not get this to work at all (2021-07 Azure). I did notice you can drag the attachment to the title of the ticket, which will get you the URL. But still so hackey.. – Jafin Jul 15 '21 at 23:36