Hi,
I would like to run a query on my CS system
I'm getting error message:
"
The fault code: 1000
The fault string: Failed to run report
"
the query is very simple, so I dont know what could be the problem
my $OpenCRResults = $csapi->QueryData($aUser, "Basic Summary", "(submitter='ccm_root') and (cvtype='problem')", undef, undef, undef);
I Succeeded to login tothe system by CLI
Please find the script below
-----------------------------------------------------------------------------------
#Include the ChangeSynergy csapi module.
use ChangeSynergy::csapi;
# define variables
$User = xxx
$password = 123
#Create a new instance of the csapi object.
my $csapi = new ChangeSynergy::csapi();
print "===========================================================================n";
print "======= Read CR from DB comccw...n";
print "===========================================================================n";
#Eval block is used for error handling.
eval
{
###################################
#Read CR data from external system
###################################
#Setup the connection parameters for connecting to the ChangeSynergy Server.
#Note however that no connection to the server is made at this point.
print "======= Set up connection to http://cm2il01cm:8600/cs...n";
$csapi->setUpConnection("http", "cm2il01cm", 8600 );
print "======= Login as $User...n";
my $aUser = $csapi->Login($User, $Password, "User", "\\cm2il01cm\ccmdb\comccw");
#Run the QueryData method to recieve a data report.
#Pass in the user object, report name, query string, query name, report title, template name and attribute list.
print "======= Run Query ...n";
print "The user is $aUsern";
print "The query $queryCRn";
my $OpenCRResults = $csapi->QueryData($aUser, "Basic Summary", "(submitter='ccm_root') and (cvtype='problem')", undef, undef, undef);
$NumOpenCR=$OpenCRResults->getDataSize();
print "nTotal number of Open CR's at last week = " . $OpenCRResults->getDataSize() . "nn";
#Loop over each returned result, in this case each problem
for(my $i = 0; $i < $OpenCRResults->getDataSize(); $i++)
{
#Get the data for the current problem
my $reportData = $OpenCRResults->getDataObject($i);
#Loop over each returned attribute
for(my $j = 0; $j < $reportData->getDataSize(); $j++)
{
#Get the data for the current attribute
my $attributeData = $reportData->getDataObject($j);
#Print the attribute name and its value
print $attributeData->getName() . ": " . $attributeData->getValue() . "n";
}
#Print a blank line between each problem
print "n";
}
};
print "nnn";
# print "=================end of file===============n";
#If any errors occured, print them to the screen.
if ($@)
{
print $@;
}
---------------------------------------------------------------------------------