Error: Cannot find a script engine for extension: "groovy"", (make sure it's on the classpath)

Hello,

I've looked through similar problems on the wiki to find an answer but can't resolve it.

I'm running the plugin on both 4.4.3 - Windows and 5.0.1-Centos versions and still getting this error. It can find the file but can't run it. Works fine in the admin panel but when I strip it out and save it to a file, I get this error:

java.lang.Exception: Cannot find a script engine for extension: "groovy"", (make sure it's on the classpath).

Greatly appreciate anyone's feedback. Thanks in advance.

Jody

Test Script is:

import com.atlassian.jira.ComponentManager

import com.atlassian.mail.Email

import com.atlassian.mail.server.MailServerManager

import com.atlassian.mail.server.SMTPMailServer

ComponentManager componentManager = ComponentManager.getInstance()

MailServerManager mailServerManager = componentManager.getMailServerManager()

SMTPMailServer mailServer = mailServerManager.getDefaultSMTPMailServer()

if (mailServer) {

Email email = new Email("ladives@gmail.com") // Set the TO address, optionally CC and BCC

email.setSubject("JIRA Test") // todo: check the subject value

String content = "Hello!!!!!! "; //TODO: Set email's body.

email.setBody(content)

mailServer.send(email)

}

2 answers

In entering the file name, I used quotes around the file name - "C:\Program Files (x86)\Atlassian\JIRA\groovy_scripts\custom.groovy". I simply removed the quotes and it worked! I made an assumption that it could not process spaces in the file path.

Just a follow up - this is using the Script Runner plug-in for JIRA.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

179 views 0 4
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