Pass the data to QueueListener to RunListener

13 views
Skip to first unread message

selva vignesh

unread,
Jul 13, 2019, 8:24:39 AM7/13/19
to Jenkins Developers
Hi,
I am developing plugin which will get the data of job, how long it's been in Queue and how long it take to finish the job.
Here I can't pass the action class from QueueListener to RunListener. Can any one help me know how to pass the data from QueueListener to RunListener.
It would be great if i get any reference for the same.

Thanks

Parichay Barpanda

unread,
Jul 13, 2019, 8:34:05 AM7/13/19
to Jenkins Developers
I implemented a class which will notifies GitLab Server about the job status. https://github.com/baymac/gitlab-branch-source-plugin/blob/develop/src/main/java/io/jenkins/plugins/gitlabbranchsource/helpers/GitLabSCMPipelineStatusNotifier.java

I have a suggestion (In reference to that), you can create a private variable say `timeTaken` in `JobScheduledListener.class` and a getter, then in `JobCompletedListener.onStarted` you can fetch the `timeTaken` variable from the Extension list like `ExtensionList.get(JobScheduledListener).getTimeTaken()`. Although I am not really sure about the extension lookup syntax though.
Reply all
Reply to author
Forward
0 new messages