Jenkins job listener

Do you know if there’s a way to create an external listener for a Jenkins job? (let’s say in a Nodejs server).

I want to know the result of a job execution when it concludes and than persist it in a database.

I want to avoid polling it at an interval and running the risk it will disappear from Jenkins (the jobs disappear if the pipeline steps change or a number of jobs per pipe is reached).

You’re probably asking why I don’t just add the code for writing in the DB at the end of the job, directly in the Jenkins pipe. The reason is I am dealing with different kinds of jobs that I don’t have access to change.

Any ideas? Thank you.

You use InfluxDB that directly writes to a database

Or you could write a Jenkins plugin that implements a RunListener that will notify your server about jobs that started, finished.

Maybe you can do this with MQ Notifier plugin