| Message |
Hi,
I am trying to create artifact in one of the tracker with following - ... .... ..... my $fValues = { 'Project Type' => "Maintenance", 'Issue Type' => "Defect", 'System Status' => "Development" };
my $flexFields = SoapFieldValues->new($fValues); my $hasFlex = 0;
while ( my ($k,$v) = each %{ $fTypes } ){ $hasFlex = 1; $flexFields -> type($k,$v) ; }
$flexFields = $flexFields -> prepare('flexFields'); $flexFields = undef if ( not $hasFlex );
my $tempTargetArtifact = $tf->TrackerApp->createArtifact3( $sk, # session "tracker1234", #tracker $srcArtifact->title, # title $srcArtifact->description, # descr undef, # group $srcArtifact->category, # cat $status, # status undef, # customer $srcArtifact->priority || 3, #prio 0, # est effor 0, # rem effort 0, # auto sum 0, # points, $srcArtifact->assignedTo, # assigned to $srcArtifact->$reportedReleaseId, # release id $targetPlanningFolder, # planning folder $flexFields, undef, undef, undef );
$tf->createAssociation($sk, $tempTargetArtifact->id, $srcArtifact->id, "Creating association for Given Artifact");
printf("%d. New Created Artifact - %s. Updating it. \n", $counter, $tempTargetArtifact->id);
my $targetArtifact = $tf->TrackerApp->getArtifactData3($sk,$tempTargetArtifact->id); ## Set flexfields $targetArtifact->flexFields->field("Issue Type","Defect"); $targetArtifact->flexFields->field('System Status',"Development");
eval { $tf->TrackerApp->setArtifactData3($sk,$targetArtifact,"Ceated Artifact",undef,undef,undef); }; if ( $@ ) { printf "ERROR: %s\n", $@; } .... ....
On exectuting this, creating and associating goes through. But flexfileds are not updated. Not only that setArtifactData3 does not update artifact. if I got to UI and press Update (or Update and View), scripts start working after that.
XML data captured is as follows. ...... ..... SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error Cache-Control: max-age=30 Connection: close Date: Wed, 14 Dec 2011 11:06:08 GMT Server: Apache-Coyote/1.1 Vary: User-Agent Content-Type: text/xml;charset=utf-8 Expires: Wed, 14 Dec 2011 11:06:38 GMT Client-Date: Wed, 14 Dec 2011 12:06:50 GMT Client-Peer: ....... Client-Response-Num: 1 Client-Transfer-Encoding: chunked CtfUserName: ..... X-Powered-By: JBoss
<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.o rg/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode xmlns:ns1="http://schema.op en.collab.net/sfee50/soap50/type">ns1:IllegalArgumentFault</faultcode><faultstring>The field Issue Type is a required field in folder tracke r4124 and therefore must have a value.</faultstring><detail><ns2:exceptionName xmlns:ns2="http://xml.apache.org/axis/">com.collabnet.ce.soap 50.fault.IllegalArgumentFault</ns2:exceptionName><ns3:hostname xmlns:ns3="http://xml.apache.org/axis/">serverNme</ns3:hos tname></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
what else should be done to make it work ?
Regards, Manish
|