We have a Jenkins scripted pipeline with 6 stages. I need to call a REST api at the end of each stage to push the status of the stage to Cassandra DB. Is there an efficient way of doing this in Jenkins Pipeline?
Currently, I am calling a function at the end of each stage with the status. I have to write this piece of code in all stages even if the stage succeeds or fails.