OnRoad Test Management

Welcome to OnRoad Test Management Sign in | Join | Help
in Search

OnRoad Weblog

Sending workitems to multiple Quality Center projects from TFS

Using our tool TFS Bug Item Synchronizer one scenario that our customers have been requesting is capability to send workitems to different Quality Center projects based on field value in TFS AreaPath –field.

And here’s how you can do it.

There is actually two ways for it, one is to let users decide this manually or then make this decision for them.

Key is to use QC Project Field –setting for your TFS projects which allows to specify into which Quality Center project TFS workitem is being sent to.

QC Project Field -setting

This field accepts values in format of QCDOMAIN.QCPROJECT.

Easiest option is to add all configured Quality Center projects into list, attach this list into selected TFS workitem field and let users manually select values for this field.

This – of course – makes it possible also user to make errors on the selection and workitem is sent to wrong Quality Center project.

To make this decision for the user based on field value in TFS AreaPath –field (or any other TFS field) workitem template needs to be modified to include couple of rules:

  1. Have default value as empty for QC Project Field
  2. If user selects known AreaPath with mapped Quality Center project, change QC Project Field value in TFS to match this selection so that TFS workitem is sent to QC
  3. If user select unknown or unmapped AreaPath, clear QC Project Field so that TFS workitem is not sent to QC

Thing to remember in here is that you cannot use AreaPath directly in a rule, instead you need to use AreaId field. And how do you know these AreaId values? Look at the workitem history:

image

In above the New Value is the AreaId for matching Area Path value that was selected.

So now that we know where to get all the values, it is time to start modifying the workitem template for our TFS project.

For this purpose I’m using TFS Power Tools.

First create a new field for your workitem, name it the way you like, values for this form below are not important for the synchronization process:

image

To specify QC destination project automatically for two AreaPaths (TestTfsforCMMI\Area 0, AreaId=151 and TestTfsforCMMI\Area 1, AreaId=152), following rules need to be added:

image

So two WHEN rules and one WHENNOT rule.

WHEN rules have following content:

image

and for each WHEN rule we need to define two additional rules:

image

COPY rule when AreaPath is changed to our’s:

image

and DEFAULT rule in case we already had the correct AreaPath when we created the workitem:

image

Our second WHEN rules is the same as the first one, except that AreaId is different:

image

and COPY and DEFAULT rules have different Quality Center project:

image image

And last thing is the WHENNOT rule:

image

For value just pick any of the mapped AreaId values and define a COPY rule:

image image

So in case none of the actual ones for AreaPath is selected, QC Project Field we defined is cleared.

To test this, QC Project Field is brought into form (in our case we called it ErrorDB) and when neither ‘TestTfsforCMMI\Area 0’ or ‘TestTfsforCMMI\Area 1’ is selected, ErrorDB remains empty:

image

When we select ‘Area 0’ we get ErrorDB populated correctly:

image

and with ‘Area 1’:

image

And when selecting value that we did not map ErrorDB is cleared:

image

One thing to configure is that when you add this field into workitem form, you might want to mark it as readonly:

image

This way users are not able to type in any values for this field and it gets changed only when AreaPath –field is changed.

Comments

No Comments