Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How to stop ScriptRunner for Jira script from running


I'm using ScriptRunner for Jira for server.

I ran a script from the Script Console to send out emails, and it ran into a loop.  How do I stop the job from running? There is no cancel button in the Script Console.

Help appreciated!



2 answers

2 accepted

2 votes
Answer accepted
Katy Kelly
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 Leaders.
Jan 14, 2020

Hi Marianne, 

At the moment you cannot stop a script once you have started it. We have an improvement request for this here you can vote for/follow:

For sending emails there is a workaround.

If you put this around the logic that sends an email it should stop it once you disable the outgoing SMTP server:

import com.atlassian.jira.mail.settings.MailSettings

MailSettings mailSettings = ComponentAccessor.getComponent(MailSettings)

if( ! mailSettings?.send()?.disabled) {

//send email logic in here

}else {

log.error("Your outgoing mail server has been disabled")


Here is an example of a method that uses this logic if you need to see how it might be used:

Kind regards,


Adaptavist Support 

0 votes
Answer accepted

Hi @Marianne Lee _Nagarro_ 

I'm affraid only way to do this i disable and enable scriptrunner again.

Thanks for the reply,  @Tomasz Bryła . I had disabled Outgoing Mail in the server setting, and the mails stopped after another 45min or so.  I'm not sure if that had any effect with the ScriptRunner job.

I suppose disabling / enabling the addon is better than having to restart Jira server which would be the last option.

But I still wonder, if there's any way to abort or interrupt a script while it is running.

Like Marina Veselić likes this

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events