adding a mail handler through scriptrunner

im trying to define a new mail handler class through scriptrunner. 

i have a test script under a script root that extends AbstractMessageHandler and implements MessageHandler 

now im trying to  add a message handler module to the plugin descriptor (reference https://developer.atlassian.com/jiradev/jira-platform/guides/email/tutorial-custom-message-mail-handler-for-jira). I did this via a script fragment

<message-handler i18n-name-key="demohandler.name" key="demoHandler" 
class="com.company.GroovyMessageHandler"
add-edit-url="/secure/admin/EditHandlerDetailsUsingParams!default.jspa" weight="0"/>

But then i get an error when JIRA starts up, about this fragment. Excerpt of the log:

at java.lang.Thread.run(Thread.java:724)
Caused by: Assertion failed:assert descriptorClass
|
null
at com.onresolve.scriptrunner.fragments.FragmentsManager.register(FragmentsManager.groovy)
at com.onresolve.scriptrunner.fragments.IFragmentsManager$register.call(Unknown Source)

and i dont know what to do with this error

1 answer

Hi Lance,

Unfortunately, adding modules to the deployment descriptor is unsupported in ScriptRunner. It may be possible to do what you need but it might be easier to create custom mail handlers using something like JEMH.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you