How to get execution time and status of each task using java in bamboo

Hi ,

I am new to bamboo and writing a plugin which will show the time taken by each task in job and status of the task in current build .

Currently I am using below line of code to get the TaskDefinition ,but no luck to get start time, end time and status of task  from task definition.

List<? extends ImmutableChainStage> stages = getChainResultsSummary().getImmutablePlan().getStages();

ImmutableChainStage stage=stages.get(0);
Set<? extends ImmutableJob> jobs= stage.getJobs();

ImmutableJob job=jobs.iterator().next();

TaskDefinition task= job.getTaskDefinitions().get(0);


Please suggest the correct java api for bamboo.





Hello @ritupurna.biswal11, welcome to the developer community :slight_smile:
I’m not able to pin point exactly where the information you need is, but I can give you an insight that what you are looking for is inside some *Results class, not at the ImmutablePlan class, which only will give you the specifications of the Plan and since 6.9.0 is not guaranteed to exist.

You could probably start from looking into the ChainResultsSummary and continue from there looking for the results you need.

Did it help?