Overriding "Delete Build"

20 views
Skip to first unread message

Shashank Bhargav

unread,
Mar 2, 2016, 12:33:13 AM3/2/16
to Jenkins Users
I need to perform some custom operations in my plugin when user does "Delete Build". How do I do this?

Baptiste Mathus

unread,
Mar 2, 2016, 1:32:37 AM3/2/16
to jenkins...@googlegroups.com
hudson.model.listeners.ItemListener#onDeleted

2016-03-02 6:33 GMT+01:00 Shashank Bhargav <shashb...@gmail.com>:
I need to perform some custom operations in my plugin when user does "Delete Build". How do I do this?

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f6a6754d-f09a-49fd-a7d8-6bcd9a7c5d27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shashank Bhargav

unread,
Mar 2, 2016, 11:46:11 PM3/2/16
to Jenkins Users
Thanks Baptiste Mathus for your quick response. 

Also, How do I check if the delete step is triggered by user or Jenkins? For ex : In cases of "Discard Build" set for job, builds are deleted by backend process of jenkins and not by user. I need to identify this, could you please help. 

Shashank Bhargav

unread,
Mar 30, 2016, 11:51:58 PM3/30/16
to Jenkins Users
I found out the root cause to this, "Discard Build" is a plugin and just calls the delete method. There isn't any field in Run listener to identify source it is coming from, as in my case whether the user is doing it or some plugin calling it. Would be great if we include some field for this and set it on user operation.
Reply all
Reply to author
Forward
0 new messages