I am working on creating a custom issue type in my plugin unable to get it work even after following the tutorials.
Here is the code
package mycomp;
import mycomp.MyPluginComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.atlassian.jira.config.IssueTypeManager;
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.config.properties.ApplicationProperties;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import javax.inject.Inject;
import javax.inject.Named;
@Scanned
public class MyPluginComponentImpl implements MyPluginComponent{
private static final Logger log = LoggerFactory.getLogger(MyPluginComponentImpl.class);
@ComponentImport
private final ApplicationProperties applicationProperties;
@ComponentImport
private final IssueTypeManager itm;
@Inject
public MyPluginComponentImpl(ApplicationProperties applicationProperties, IssueTypeManager itm) {
this.applicationProperties = applicationProperties;
this.itm = itm;
createIssueType();
}
public String getName() {
return "testcomp";
}
public void createIssueType(){
itm.createIssueType("testcomp","Test",0l);
}
}