In this blog post we cover the new Templates feature that was first released in TMO version 4.5.
- Introduction
- Example and description of a Template
- Expressions in templates
- Creating a template while creating a work item
- Creating a template from scratch
- Setting a Template as Default
- Managing Templates
Introduction
Templates are a powerful way to get TMO to automatically populate fields in work items from a set of default values that you setup in a template. You can use any free text value in a template or you can use “Expressions” that instruct TMO to extract out information from the current selected Outlook mail (or any item) and use those values to fill the work item fields.
You can create as many templates as you like. TMO groups templates based on Collection Url, Team Project and Work Item Type. For e.g. you can have a template named “Default Bug” template under Collection named say Mars but under different projects say “Phoenix” and “Icarus” under Mars. Here is a screenshot of how templates are grouped. For more details on this please read “Managing Templates“.
Example and Description of a Template
Consider the following template. We will explain how you get to this screen in the following sections. For now let’s understand what the various fields on this screen mean.
Here is what the various options mean on this form.
- Name – Any name that you want to give to this template. Names don’t have to be unique but we’d recommend that you use unique names so it is easy to identify the templates.
- Description – Free text field for you to enter any description for this template
- Work Item Type – This indicates what work item type this template corresponds to. Here in this example we are setting up a template to populate a Task work item type.
- Set As Default – If this check box is checked then TMO will always automatically use this template whenever you create the specified work item type. In this case it is a “Task”.
- Attach outlook item with work item – If this check box is checked TMO will automatically attach a copy of your Outlook email with the work item when it is created.
- Copy Outlook attachments to work item – If you check this check box, TMO will take any attachments that are present in the Outlook email and attach them to the work item when it is created
- List of all work item fields – Next is a list of all the fields that are present in your TFS for this work item type. This list is not static. TMO automatically finds out all the fields that are setup in TFS for this work item and gives you an option to specify a value for them.
- State – This column indicates the State of the field in the Template
- New – This is a new field and does not currently exist in the template.
- Unmodified – The value for this field has been saved in the Template before and has not been modified yet.
- Edited – The value that you see on the screen is different from the value that is saved in the template right now for this field.
Expressions in Templates
TMO can extract values of various fields out of Outlook and use those as the values of various fields in your templates. As of writing this blog post following fields are supported. To use them simply use the expression name “exactly” as the value of a field. Please note expressions are case-sensitive.
Expressions | Description |
---|---|
[TOEMAIL] | This will be replaced by the recipient’s email address in the Outlook email. |
[TONAME] | This will be replaced by the recipient’s name in the Outlook email. |
[BODY] | This will be replaced by the body or text of the Outlook email. |
[FROMEMAIL] | This will be replaced by the sender’s email address in the Outlook email. |
[FROMNAME] | This will be replaced by the sender’s name in the Outlook email. |
[SUBJECT] | This will be replaced by the subject of the Outlook email. |
[SENTDATE] | This will be replaced by sent date of the Outlook email. |
[RECEIVEDDATE] | This will be replaced by the current date as per your computer’s calendar. |
[NOW] | This will be replaced by the received date of the Outlook email. |
Consider the below template setup
In the above template screenshot TMO will always
- [BODY] – Use the Body of the email as the value for the “Description” field as you create a Task.
- [NOW] – Populate the current date for the “Created Date” field.
- [TONAME] – Use the Outlook Name of the recipient as the value for the Assigned To field in the Task work item.
- [SUBJECT] – Use the subject of the email as the value of the “Title” field in the Task work item.
Creating a Template while creating a work item.
You can create a template while creating a work item. To do that simply create a work item as you normally would by clicking the New button and selecting the work item type that you want to create. However instead of saving the work item by clicking the “Save” button on the form, click the “Capture As Template” button.
This will open the screen you saw in the Example and description of a Template section. For a description of the fields please see the Example and description of a Template section
Creating a template from Scratch
While we recommend creating a new template while creating a work item you can also use the “Add New Template” feature to create a new template. To do this
1. Click the Template Manager button in the TMO toolbar. See screenshot below
2. Click the Add New Template button and pick a collection, team project and work item type.
3. This opens up the form for the particular work item type that you can use to enter values for various fields to save them in the template. For e.g. in the screenshot below we have assigned the [BODY] expression to the Description field, [SUBJECT] for the Title of the work item.
1. Click the Save As Template button when ready, this will open up the familiar Template Capture dialogue box.
2. Verify all the fields have been captured properly, give the template a name and setup optional settings as explained in the Example and description of a Template section and save it.
The template is now ready for use.
Setting a Template as Default
You can set a template as Default Template. Once you do that then every time you create a new work item of that type, TMO will automatically use that Template to pre-fill the values.
Managing Templates
You manage templates by launching the Template Manager from the Template Manager button in the TMO toolbar.
This launches the following window from where you can manage your templates including adding new templates, setting an existing template as Default Template and deleting templates.
The template doesn’t seem to pull the correct [FROMEMAIL] for users inside the company. If the email is from a person from another company, the [FROMEMAIL] works fine.
The format it gets for internal email addresses is… “/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (XXXXXXXXXXXXXXX)/CN=RECIPIENTS/CN=XXXXXXXXXXXXXXXXXXXXXX-FIRSTNAME.LASTNAME”
We like to link all our incoming PBIs to an Epic. Is there any way to have that link created inside the template?
Can a template distributed to other users (Import\export) or stored in TFS and made default for everyone?
Thank you Allan. Yes a template can be shared with other users however this is a manual process for now. To share your templates with other users you can simply copy the json files from %appdata%\vi8\tmo\templates folder with target users. If they copy the template files in the same directory on their machine and restart Oultook, TMO will automatically discover and load the new templates.
Thank you! That’s very helpful.I can automate copying the template json using PowerShell or SCCM.
Is there a way to add logic to the expressions? For example, the ability to say [NOW]+[3DAYS]?
Is there a way to use regular expressions on the body of the email to place certain parts of it in our fields?