I am using releaseVersion of VersionManager. Somehow it looks like the VersionReleaseEvent is not automatically fired when calling this releaseVersion method. But I want to use ScriptRunner listening to this event VersionReleaseEvent.
Can somebody confirm, that I have to take care about this event myself?
There is only little documentation on custom events for Jira development. I am not sure, if it is really only use the constructor of VersionReleaseEvent and publish it via EventPublisher?
Or would you propose to use another Java API call to release a version?
Thank you very much in advance if you have ideas on this topic!
Looking at VersionManager source code, the creation of the event is part of the releaseVersion method.
package com.atlassian.jira.project.version; /...
public class DefaultVersionManager implements VersionManager {
//...
// ---- Release Version methods ----
@Override
public Version releaseVersion(final Version version, final boolean release) {
releaseVersions(Collections.singleton(version), release);
final Version updatedVersion = getVersion(version.getId());
if (release) {
eventPublisher.publish(new VersionReleaseEvent(updatedVersion));
} else {
eventPublisher.publish(new VersionUnreleaseEvent(updatedVersion));
}
return updatedVersion;
}
//...
}