TestTrack has built-in item numbering, giving you the ability to quickly reference a defect or test case by number. What this lacks though is any context or details on the item being referenced. Telling someone “go review test case #432″ doesn’t provide them with any usable information until they actually jump into TestTrack and start reviewing. This can be a pain for some teams, where item information is passed around a lot via email or informal discussions. If you’re in a meeting to triage defects or doing the daily stand-up on project progress, efficiency is important and having one identifier that gives everyone the key details on an item can save time and avoid confusion.

To solve this challenge, many customers define their own numbering scheme that in most cases is a combination of several pieces of metadata on the item. So they might abbreviate the product a defect was found in, then tack on the priority along with a unique number and use that as the item “number.” With the release of calculated fields in TestTrack 2012, it’s much easier to define these custom number formats.

For this example, I’m going to setup a pretty simple numbering scheme for test cases that incorporates the product and actual test case number. First step is to create you custom calculated field.

Create a custom calculated field

With the field created, click Edit down in the Formula area and paste in the code below.

var vNumber = Item.fieldValue("Number");
var vPadding = "";
var vPaddedNumber;
var vTCNum;

// Pad #s so they always have the same number of digits, ensures sorting works.
if (vNumber < 1) { vPadding = "0000"; }
else if (vNumber < 10) { vPadding = "000"; }
else if (vNumber < 100) { vPadding = "00"; }
else if (vNumber < 1000) { vPadding = "0"; } // will get us to 9999


// Concatenate Product mapping with padded number.
if (vNumber > 0)
{
vPaddedNumber = vPadding + vNumber;
vTestSequence = Item.mappedValue("Product") + "." + vPaddedNumber;
}
else
{
vTestSequence = "";
}

// last statement sets the return value
vTestSequence;

A few things of note here:

  • We’re padding the actual test case number with extra zeros, so that sorting works correctly. The end result is actually a string, so if you don’t pad you’ll see that 11 is considered less than 110.
  • product value abbreviations are mapped as shown below.

Define your formula and field mappings

Share on Technorati . del.icio.us . Digg . Reddit . Slashdot . Facebook . StumbleUpon

Related posts:

  1. Video: Using Date Functions with Custom Calculated Fields
  2. Video: Using Workflow Events with Custom Calculated Fields
  3. Webinar Recording: Intro to Calculated Fields
  4. Introducing Calculated Fields in TestTrack
  5. Webinar Series: Using Calculated Fields in TestTrack
No Comments

Tags: , ,

No comments yet.

Leave a comment

WP_Big_City

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 

Spam Protection by WP-SpamFree