I currently try to get this running:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.plugin.PluginAccessor
import com.atlassian.jira.user.ApplicationUser
import com.valiantys.software.elements.api.content.*;
import com.valiantys.software.elements.api.model.*;
@WithPlugin("com.valiantys.software.elements.api.model")
//@WithPlugin("com.valiantys.software.elements")
//@PluginModule
//PanelContentService panelContentService
PluginAccessor pluginAccessor = ComponentAccessor.getPluginAccessor()
Class panelContentServiceClass = pluginAccessor.getClassLoader().findClass("com.valiantys.software.elements.api.content.PanelContentService")
Class panelRefClass = pluginAccessor.getClassLoader().findClass("com.valiantys.software.elements.api.model.PanelRef")
Class attributeRefClass = pluginAccessor.getClassLoader().findClass("com.valiantys.software.elements.api.model.AttributeRef")
def userManager = ComponentAccessor.getUserManager()
def panelContentService = ComponentAccessor.getOSGiComponentInstanceOfType(panelContentServiceClass)
// Constants to customize
def PANEL_NAME = "Employee Checklist"
def CHECKBOX_ATTRIBUTE = "Done"
def USER_ATTRIBUTE = "Main responsibility"
// Define Elements panel
def elementsPanel = panelContentService.getPanel(issue, panelRefClass.byName(PANEL_NAME))
// Get Elements panel items
Set<ApplicationUser> usersSet = new HashSet<ApplicationUser>()
for (def panelItem : elementsPanel.getPanelItems()) {
def taskDone = panelItem.getAttributeContent(attributeRefClass.byName(CHECKBOX_ATTRIBUTE))?.getValue()
if(!taskDone) {
def owner = panelItem.getAttributeContent(attributeRefClass.byName(USER_ATTRIBUTE))?.getValue()
if(owner != null) {
usersSet.add(userManager.getUserByName(owner))
}
}
}
return usersSet
But i always get this error:
The script could not be compiled:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during conversion: Requested plugin com.valiantys.software.elements.api.model was not installed/enabled, compiling source unit Script836.groovy. java.lang.Exception: Requested plugin com.valiantys.software.elements.api.model was not installed/enabled, compiling source unit Script836.groovy. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80) at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
What do i missed?
Thanks in advance.
Hello Marco,
I'm Cécile, I'm part of the Elements team.
I'd invite you to raise a request on our Support Portal. The Support team will be happy to help you with this configuration.
Kind regards,
Cécile
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.