Easily inserting a screenshot in a TFS work item

This article was migrated from an older iteration of our website, and it could deviate in design and functionality.


This post explains how to add a custom control to your TFS installation to make it a lot easier to simply paste a screenshot directly into the work item editor.

Estimated read time : 4 minutes

Jump to

Update: Shortly after posting this I was informed by Christian Landgren that you can go straight to the Attachments tab when editing a work item and hit CTRL+V to paste a screenshot. It will automatically be named "Screenshot.jpg". Thanks for the tip, Christian!

I think this is new in VS 2010? I guess I did a lot of work to no benefit whatsoever. :) Only reason I can think of for still using this approach is if you want a mandatory screenshot field

Prerequisites

Modify work item types to include the screenshot control

After installing TFS Power Tools you’ll notice a few additional menu options on the Tools menu.

Simply click Process Editor –> Work Item Types –> Open WIT from Server

Open WIT from Server menu option

…next select the work item type you want to modify:

Selecting a work item type to modify

Switch to the Layout tab, right-click the position where you want the screenshot control to appear and then click New Control:

Adding a new control to a work item definition

Enter a suitable label (optional) and then select ScreenshotControl as the control type:

Adding a new work item control

Paste a screenshot directly into your work item

Create a new Bug work item to see the screenshot control in action.

Simply take a screenshot so that you have an image in your clipboard. Simply hit the “Print Screen” key, or create a screen clipping with a tool such as OneNote, Jing, or SnagIt.

Click the Capture button. You will then be prompted to add a name and an optional comment for your image:

TFS Work Item Screenshot Control

The captured screenshot will now be available among the work item attachments:

Work item attachments

Simply double-click My screenshot.jpg to view it.

Customize your process template to include the screenshot control

You have to add the screenshot control to each work item type individually for all projects where you want the screenshot control to appear. If you want the screenshot control to appear for all work item types for all new projects you have to modify the process template on your TFS server. Here is some additional information about modifying TFS process templates.