I'm in a process of writing a Bamboo plugin, the bulk of which is complete.
The plugin works by starting a remote process off via a post request to a server and then polling the same server until it gets a message saying the process has completed or an error occurred - this part works.
I would like to add some extra logic where I can notify this server if the user cancels the job, however I'm unsure of how to go about this.
I have played about with creating another task which runs as a final task, however I don't know how to detect if any of the previous tasks failed or were cancelled.
I have tried using List<TaskResult> taskResults = taskContext.getBuildContext().getBuildResult().getTaskResults();
to get a list of the previous Task's results, however this always appears to return 0 Task Results.
I have also tried using a Post-Build Completed Action Module, however I'm unsure how I would add this to a job and the documentation on this has me slightly mystified.
If anyone could help me in the right direction I would appreciate it.