Delete created Bulk Operation via plugin listener

Am developing a plugin, which add new bulk operations: its made via PluginEnabledListener which make more or less something like this to register:
ComponentAccessor.getBulkOperationManager().addProgressAwareBulkOperation(BulkAssignOperation.NAME_KEY, BulkAssignOperation.class);

The question is: How to unregister/delete operation, when plugin is uninstalled/disabled. What to write in PluginDisabledListener?

1 Like

Obtain the source code to Jira Software server and search its .java source files for PluginEnabledEvent, @PostConstruct, LifecycleAware; their contents will guide you.
Also, this material might help: https://developer.atlassian.com/jiradev/jira-architecture/building-jira-add-ons/jira-plugins2-overview/jira-plugin-lifecycle

Depending on what you have in mind, you might want to wait for any/all of the Spring stated, Plugin stated, and LifecycleAware started events before registering, and to unregister upon receipt of any of the counterparts to those events.