0

New to Perl and new to ClearQuest Perl API both. I am trying to clear some values from a CQ form. I am able to clear values by simply setting the value to "" but it doesn't work on lists. Any idea how this can be done?

# following doesn't work on lists. What to do? 

    $entity->SetFieldValue("Foo_List", "");


# following works just fine

    $entity->SetFieldValue("barstatus", "");

Here is CQ API reference: http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/r_examples_mangngrecrds.htm

  • Not sure how to use undef in this scneario. I am accessing "Foo_List" through entity object. It's not directly available to me. Or is it? I thought I can only use entity->MehodName to operate on Foo_List. (Sorry, I am new to Perl) – InstantSaint Oct 22 '10 at 19:06
  • I mean `$entity->setFieldValue("Foo_List", undef);` – hobbs Oct 23 '10 at 06:04
  • correct link for API should be: http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/c_entity_mthds.htm – AspiringGuru Oct 23 '10 at 21:13

1 Answers1

0

As I understand your API, the undef is unlikely to work. setFieldValue can not be called on a list to begin with. I don't know much Perl either. But try creating a loop to read all values, and delete each value using DeleteFieldValue method of entity object. All methods of entity objects are listed here: http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m1/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/c_entity_mthds.htm

I don't know Perl syntax well. But someone here may be able to help.

hth.

AspiringGuru
  • 137
  • 1
  • 7