Our custom listener plugin is not listening after the jira service restart?

Hi Team,

We have developed a custom listener plugin to update custom field value based another custom field value,and it is working fine when server is up and running. And the problem is, it is stop working when we restart the jira service/sever.

Seems to be jira is not picking the our custom listener plugin features while restarting the jira service.

To make it work, again we need to upload the plugin after server up and running.
We are loading plugin through Application under Add-on section?

Hello surigongati! Just wanted to clarify for you that this is a community of developers and not official support; but you get a lot of help!

Did you list your listener under the Spring plugin-context xml file, (Under META-INF package) in resources?
You should have something like this:
<bean id="myCustomListenerId" class="com.myjiraplugin.plugin.jira.listener.CustomListener"/>
Listened in

Hi Kallas,
Thank you for the reply.I have added bean to plugin-context.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    <bean id="moduleListenerId" class="com.gtnexus.module.plugin.ModuleChangeListener"/>

But still it is not working after the server restart.I am missing any information?

Does the component ID matches your key in atlassian-plugin xml?

    <component key="myCustomListener"
        <description>Sends special email once issue updated


we are using atlassian-spring-scanner-runtime
I don’t think so,need of importing component in atlassina-jira.xml file.

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
        <vendor name="${project.organization.name}" url="${project.organization.url}" />
        <param name="plugin-icon">images/pluginIcon.png</param>
        <param name="plugin-logo">images/pluginLogo.png</param>

    <!-- add our i18n resource -->
    <resource type="i18n" name="i18n" location="gtn-module-plugin"/>
    <!-- add our web resources -->
    <web-resource key="gtn-module-plugin-resources" name="gtn-module-plugin Web Resources">
        <resource type="download" name="gtn-module-plugin.css" location="/css/gtn-module-plugin.css"/>
        <resource type="download" name="gtn-module-plugin.js" location="/js/gtn-module-plugin.js"/>
        <resource type="download" name="images/" location="/images"/>

    <component key="moduleListenerId" class="com.gtnexus.module.plugin.ModuleChangeListener" public="false">
        <description>Sends special email once issue updated</description>
</atlassian-plugin> ```

I missing any thing in java listener class. I am missing any spring annotations?

public class ModuleChangeListener implements InitializingBean, DisposableBean {
private static final Logger log = Logger.getLogger(ModuleChangeListener.class);

private final EventPublisher eventPublisher;
private final EventTypeManager eventTypeManager;
private final AttachmentManager attachmentManager;
private final ApplicationProperties applicationProperties;

public ModuleChangeListener(EventPublisher eventPublisher, EventTypeManager eventTypeManager,
		AttachmentManager attachmentManager, ApplicationProperties applicationProperties) {
	this.eventPublisher = eventPublisher;
	this.eventTypeManager = eventTypeManager;
	this.attachmentManager = attachmentManager;
	this.applicationProperties = applicationProperties;

public void afterPropertiesSet() throws Exception {

public void destroy() throws Exception {

public void onEvent(IssueEvent event) {
	//my code start here and it is not working when server is restarted.


Answer:“Due to the shortcomings of the component initialisation stage, a listener on the PluginEnabledEvent is the earliest time that you should attempt to do any serious wiring into JIRA. For example, if your plugin needs to ensure there are particular custom fields created in JIRA for the plugin to function properly, the plugin should attempt to create them during this stage, and not earlier.”