Jira version: 6.4.9
I have written a custom class in order to add some functionality and stored it to .../webapp/WEB-INF/classes/com/custom/Last24Hours.class. I am calling a method of the class from a scripted field and have tried the same from the script console. Here's the code:
package com.custom
def todaysDate = new Date()
def Created = issue.getCreated()
def Updated = issue.getUpdated()
def retVal = new String()
def last24Hours = new Last24Hours()
retVal = last24Hours.getChanges(todaysDate,Created,Updated)
return retVal
I get the following error message:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script849.groovy: 7: unable to resolve class Last24Hours @ line 7, column 19. def last24Hours = new Last24Hours()
^ 1 error
I can access a .groovy script in the same location from a scripted field. What is wrong?
Not sure, but don't you have to import Last24Hours somewhere?
It's in the same package. I've tried it, though, but this didn't work either:
package com.custom
import com.custom.Last24Hours
def todaysDate = new Date()
def Created = issue.getCreated()
def Updated = issue.getUpdated()
def retVal = new String()
def last24Hours = new Last24Hours()
retVal = last24Hours.getChanges(todaysDate,Created,Updated)
return retVal
This was executed from the script console. I got the following error message:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script853.groovy: 1: unable to resolve class com.custom.Last24Hours @ line 1, column 1. import com.custom.Last24Hours ^
1 error
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.