Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Use ScriptRunner to block Jira Notifications with word Subscription in Subject

Kathy Dickason
Contributor
March 31, 2026

I'm trying to see if I can use Scriptrunner to block Jira Filter Subscription emails system-wide from going out on a Government system (don't ask why).  These emails have the word "Subscription" in the Subject, so a way to block any email with "Subscription" in the subject would be the goal.   A Listener will not be triggered by a Subscription, so I can't use that.  Any other ideas?

2 answers

2 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
Martin Runge
Community Champion
March 31, 2026

Hi @Kathy Dickason,

To block Jira Filter Subscription emails based on the Summary, you need to go below the event layer and access the Mail Queue directly. Consider intercepting the MailQueue and removing items that meet your criteria before they are sent to the SMTP server.

Running a ScriptRunner Scheduled Job script using a ComponentAccessor each time to "scrub" the queue could be a solution. It requires the job to run frequently to catch emails before the standard Mail Queue flush, which happens every 1 minute by default. You might even consider flushing only every 3-5 minutes to minimize the risk.

The better way: you can use off-server logic and configure your mail server to act as a content filter, dropping any outgoing mail that contains the "Subscription" header. This approach ensures that even if an email slips through due to timing issues or a ScriptRunner error, the message is caught and discarded at the transport layer before reaching an inbox.

0 votes
Answer accepted
Arkadiusz Wroblewski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
March 31, 2026

Hello @Kathy Dickason 

Filter subscription mails are not normal issue events. They are generated by Jira’s scheduled subscription/mail queue processing, and in the logs they show up as com.atlassian.jira.mail.Subscription. That is why your Listener approach does not really have anything reliable to hook into here. ScriptRunner listeners are event-driven, so this is the wrong layer for that job.

I would do that at the SMTP relay / mail gateway, not inside Jira. That is much cleaner than trying to intercept Jira’s own outbound queue mid-flight. The Jira-side mail queue is shared with other notifications, so filtering there is not very surgical.

DEPLOYMENT TYPE
SERVER
VERSION
10.3.10
TAGS
AUG Leaders

Atlassian Community Events