Postlagerkarte
Postlagerkarte

Reputation: 7117

How to link to the attachments added from the description of a workitem?

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?

Upvotes: 78

Views: 42435

Answers (8)

user2965205
user2965205

Reputation: 184

You could inspect the attachment URL in Chrome Developer 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>
</div>

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

Upvotes: 10

Shamrai Aleksander
Shamrai Aleksander

Reputation: 15988

As a 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 the description field.

Upvotes: 14

rtrrtr
rtrrtr

Reputation: 692

  • 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

Upvotes: 41

PRUDHVI BIRUDA
PRUDHVI BIRUDA

Reputation: 29

It is now possible, maybe. Go to 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.

Upvotes: 1

jayz
jayz

Reputation: 401

Try toggling features in the settings.

enter image description here

Upvotes: 0

Patrick Koorevaar
Patrick Koorevaar

Reputation: 1343

If the attachment is an image and you want to show the image in the Description or Comment field, you can copy the attachment link (see post of O. R. Mapper) and then put an asterix in front of it:

![MicrosoftTeams-image.png](https://dev.azure.com/company/guid1/_apis/wit/attachments/guid2?fileName=MicrosoftTeams-image.png)

Upvotes: -1

O. R. Mapper
O. R. Mapper

Reputation: 20720

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.

Upvotes: 15

SouthSun
SouthSun

Reputation: 79

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.

Upvotes: 6

Related Questions