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
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

349 views 0 1
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