« AddListMember | Main | Daylight Savings Time & Clearcase »

PQA Dynamic Lists

  • Changed Dynamic Lists to properly handle bad data

Dynamic Lists and Bad Data

I now have pqamerge properly creating Dynamic Lists. In the past I would call SetFieldChoiceList, which would allow validate and commit to work, but which wouldn't actually add a member to the Dynamic List. I've since changed that.

The first problem I hit was that Clearquest would treat "1.A" as the same as "1.a". So when pqamerge attempted to add "1.a" to the Dynamic List it would fail. I needed to compare ignoring case. In Perl usually one uses a regex for that and specifies "i" to ignore case.

if ($var =~ /^$pattern$/i) {
  <matched ignoring case>
} # if

But some of the values of the various Dynamic Lists contain regex meta characters (e.g. "?" or "(") which caused me problems. I've fixed those now.

if ("\L$var\E" eq "\L$pattern\E") {
  <matched ignoring case>
} # if

The above basically says to downshift characters between the "\L" and the "\E". Then a regular eq is used so as to avoid problems with interpreting regex meta characters.