| || |
Cascading lists and the OTA/API
Using QC version 9.2, tool written in Visual Basic 2005.
We have recently customized the defects module in our QC project such that there is a dropdown list (ddl) dependency in one field based on the value selected from a ddl for another field (the lists sort of cascade). Check this out:
There are three fields in our project: "Vendor," "System," and "SubSystem."
Of these fields, "Vendor" is the master field, and its associated ddl is static. However, more than one separate ddl exists for the "System" field, and the ddl that gets associated with this field depends on the value selected for the "Vendor" field. The same concept holds true between "System" and "SubSystem": multiple lists exist for the "SubSystem" field and the one that gets linked to that field is determined by the value selected in the "System" field.
Along with this, we have a tool that operates through the OTA/API that is designed to upload defect data (new defects as well as updates to existing defects) from a csv file.
This tool is running into problems now that we have implemented this cascading list association concept across the three fields. Even though the first thing I do is set the vendor from the static ddl (and actually, right now, I'm always setting the vendor to the same value), the right "System" list does not get associated with the "System" field, and so when I attempt to set the value of the "System" field with what should be a valid value, my tool dies, telling me that I need to select a value for "System" from the corresponding list.
I anticipate that the same will happen with SubSystem, but once I figure out one, I have the other figured out as well, so that's not a big deal.
So far, I have tried the following:
1. Simply setting vendor, then trying to set system. No go.
2. Setting vendor, posting the bug data back to QC through the API (bug.Post()), then setting system. No go-- same error.
3. Setting vendor, posting the bug data back to QC through the API (bug.Post()), then re-reading the bug, and attempting to set System. No go-- same error.
Anybody have any insight as to how I might solve this problem?
Along the same lines, has anybody dealt with this type of setup using the actual Excel add-in? I've only ever heard bad things about it, but am planning to give it a try anyway, though it's not a viable long-term option....
Thanks in advance for any insight or assistance.
Please forward all my mail to the corner of Pork & Beans.
Re: Cascading lists and the OTA/API
I think the problem here is that workflow code does not execute when you interact through the API. As a result, your lists are not being switched around.
To get around the problem, you can do one of two things:
1) For the fields that have dynamic list assignments, remove the "limit to list" restriction so that any value is allowed. You could possibly even do this through the API before making your change and turn it back on when complete.
2) For each dynamic list field, create a huge master list that contains all the possible values from the smaller lists. This will ensure any value you try to set is not rejected. Make your defect settings for the field use the master list and then have the workflow immediately change that to something else when the user goes in through the standard QC GUI.
Hope this helps.