Topic
4 replies Latest Post - ‏2012-11-16T18:26:26Z by SystemAdmin
SystemAdmin
SystemAdmin
24948 Posts
ACCEPTED ANSWER

Pinned topic Importing defects

‏2012-11-09T17:05:35Z |
I'm trying to write a process to import records into a stateful defect record. My problem is how do I get it into the proper state and how do I get all of the other fields to translate properly? My script calls BuildEntity, which on a stateful record, executes a Submit action. So after this is done and I validate and commit I'll get a defect in the Submitted state. But the defect I'm importing was in the Assigned state. If I feed State = 'Assigned' into the process Clearquest tells me that the State field is readonly. Similarly other fields such as say Category are marked as readonly during submission, but perhaps optional in another state.

I know this can be done because the klunky Clearquest Import Records from the Clearquest client manages to do this somehow.

Now I guess I could do a complicated algorithm to figure out what state transitions I need to do and in what order to do them to get from say Submitted -> Verified but I'd have no way that I can see to know in which state transition I need to set Category or some other field at the proper time.

So how does one do this?
Updated on 2012-11-16T18:26:26Z at 2012-11-16T18:26:26Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    24948 Posts
    ACCEPTED ANSWER

    Re: Importing defects

    ‏2012-11-09T17:49:30Z  in response to SystemAdmin
    A little research here has led me to believe that the Import action is what I want. But how do I call Import from Perl?
    • SystemAdmin
      SystemAdmin
      24948 Posts
      ACCEPTED ANSWER

      Re: Importing defects

      ‏2012-11-16T17:55:56Z  in response to SystemAdmin
      Bump! Anybody??? Is Import and action that you cannot call from the Perl API?
      • pdubovitsky
        pdubovitsky
        376 Posts
        ACCEPTED ANSWER

        Re: Importing defects

        ‏2012-11-16T18:20:03Z  in response to SystemAdmin
        "Import" action cannot be called from the API yet. It is what I have been asking from Rational for a long time.

        Pavel
        • SystemAdmin
          SystemAdmin
          24948 Posts
          ACCEPTED ANSWER

          Re: Importing defects

          ‏2012-11-16T18:26:26Z  in response to pdubovitsky
          Thanks Pavel. I surely owe you a few beers by now.

          I've submitted a defect to IBM 88995 227 000 <https://www-947.ibm.com/support/servicerequest/problemDescriptionSelect.action?srNumber=88995&branch=227&retainCountryCode=000&sourceAppl=XSR&sourceNode=prNode1&sourceTranId=1831353088981136&draft=0&userType=0>

          Problem Details
          .
          Product or Service: Rational ClearQuest for Windows 7.1.2
          Component ID: 5724G3600
          .
          Operating System: Windows (Microsoft)
          .
          Problem title
          How to call the Import action from a Perl script
          .
          Problem description
          I wish to import records into Clearquest. I know of the process to
          import records using the Clearquest client but that's GUI only and
          can't be automated. So I wrote a perl script which imports stateless
          records pretty easily by simply adding them. But stateful records are
          more tricky.

          I've read in the Clearquest API Reference manual about the Import
          action but I saw no API to the Import action.

          Stated differently, I believe that BuildEntity of a stateful record by
          default calls the Submit action and has no parameters to tell it to
          instead call the Import action. I could attempt to call the EditEntity
          action with the Import action but that fails with:

          CRMUD0012E The actionDef Import is of type IMPORT, but must be one of
          these types: AD_MODIFY or AD_CHANGE_STATE. at (eval 17)[C:/Program
          Files/IBM/RationalSDLC/common/lib/perl5/5.8.6/perl5db.pl:628] line 2.
          .
          Business impact ( BusImpact )
          Unable to easily populate test Clearquest databases.