We are using ElectricFlow 6.0.4. It seems the `getObjects` ec-perl and REST API is broken. We are working on application for which we need to get workflow transition info. The only thing that the application knows is the subjob name. I can get the state associated with it using `/jobs//callingstate`. We need to build "state" object from stateId to eventually get to workflow & transitions. However we cannot get getObjects to work using objectId of state or in general otherwise using valid objectId.
Can anyone please suggest or provide a working example of getObjects rest API request or an approach to get to workflow by just jobname?
Answer by nitinp · Mar 23, 2017 at 11:09 PM
Below code snippet gets the projectName, workflowName and stateName using jobName
use ElectricCommander; $| = 1; my $ec = new ElectricCommander({server=>'localhost'}); my $xpath = $ec->getJobInfo($[/myJob/name]); my $callingStatePath = $xpath->findvalue("//callingState"); print $callingStatePath."\n"; my @fields = split '/', $callingStatePath;; print "projectName="."$fields[2]\n"; print "workflowName="."$fields[4]\n"; print "stateName="."$fields[6]\n";
Electric Cloud powers Continuous Delivery, helping organizations developing deliver better software faster by automating and accelerating build, test, and deployment processes at scale. Industry leaders like Qualcomm, SpaceX, Cisco, GE, Gap, and E*TRADE use Electric Cloud solutions to boost DevOps productivity and Agile throughput.