Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
Topic Title: Obtaining Child CR ids from csapi
Topic Summary:
Created On: 6-Apr-2006 16:00
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 6-Apr-2006 16:00
User is offline View Users Profile Print this message


Aaron Bloomfield

Posts: 2
Joined: 1-Mar-2006

I am looking to somehow retrieve a list of child CR ids associated with a Parent CR using the csapi. It looks as if the only supported way to do this is with a report. However, I can not figure out a way to get the data I need without having to parse through a ton of html code. Is there a way to simply retrieve the Child CR ids associated with a parent CR? Here is the code I have which retrieves the correct information surrounded by heaps of html:
eval {
  my $queryString = "(cvtype='problem') and is_subsystem_cr_of('probtrac/problem/problem1620/1')";
  my $results = $csapi->ImmediateQueryHtml($aUser, "Fix Review Report", $queryString, undef, "Subsystem CRs for 1620");
  my $report = $results->getResponseData();
  print "$report";
};
Report this to a Moderator Report this to a Moderator
 6-Apr-2006 16:38
User is offline View Users Profile Print this message


Aaron Bloomfield

Posts: 2
Joined: 1-Mar-2006

Okay, so I figured out a solution, but if anyone has a better way - please let me know.

Here is what I did:

eval {
  my $queryString = "(cvtype='problem') and is_subsystem_cr_of('probtrac/problem/problem1620/1')";
  my $results = $csapi->QueryStringData($aUser, "Fix Review Report", $queryString, "problem_number");
  my $report = $results->getXmlData();
  my $size = $results->getDataSize();
  my $i = 0;
  for ($i = 0; $i < $size; $i++) {
    my $number = $results->getDataObject($i)->getDataObjectByName("problem_number")->getValue();
    print "$number\n";
  }
};

Report this to a Moderator Report this to a Moderator
 4-May-2006 14:33
User is offline View Users Profile Print this message


michael Barnes

Posts: 85
Joined: 12-Nov-2003

That is essentially the solution that Telelogic consultants gave me for a similar problem (I was after the parent CR for the child CR, so that the owner of the parent could be notified by email).

Their solution (hacked from an existing solution) was essentially:
  • define a report on the known CR (via report builder interface), with sub-report on the CRswanted. Only attributes identified in the sub-report are available for use.
  • run the report.
  • process each CRin the sub-report.

    In my example (snippet below) the report name is a parameter to the script, and the CR number is obtained from the active session (because this was designed to be a trigger from the lifecycle).
    The "$i" loop is probably not needed because there should be exactly one CR returned, but it provides a "fail safe" for cases where zero or many CRs are returned from the query.

  • Report this to a Moderator Report this to a Moderator
    Statistics
    20925 users are registered to the Telelogic SYNERGY forum.
    There are currently 1 users logged in.
    The most users ever online was 15 on 15-Jan-2009 at 15:34.
    There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
    You have posted 0 messages to this forum. 0 overall.

    FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.