Am I right that it is impossible to create classes in script body?
Like below. sorry if there are grammar mistakes in code, I am newbie
Class newEvent (AbstractVersionEvent event){
def version = event.version
def versionName = version.name
logger.info "version: "+versionName+"\n"
def project = version.getProject()
logger.info "project id: "+project.id+"\n"
def projectCategory = project.getProjectCategory()
}
Class newUpdateEvent (VersionUpdatedEvent event) extends newEvent{
def oldVersion=event.originalVersion
def oldVersionName=oldVersion.name
}
Can you describe what are you trying to achieve with Scriptrunner? What business case are you looking for to resolve?
I try to write my own version synchronizer based on AbstractVersionEvent.
And I want to create new class, and object of this class will store all information about event that I need. If event will be a VersionUpdatedEvent than another extended class with additional fields will be used.
When I tried to write new class construction in script it don't see my class. And my question is it possible to construct new class in script body? Or the only way to create separate file with new class and place it on the server locally and implement import header for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And why don't you just create a script listener based on VersionUpdatedEvent with your custom logic (example https://scriptrunner.adaptavist.com/latest/jira/listeners.html#_custom_listener_example)?
It seems that you can create your custom listener (see below doc) but I think this can be over-complicated to maintain;
https://scriptrunner.adaptavist.com/latest/jira/listeners.html#__heritage_custom_listeners
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.