Try this.
FieldConfigManager fieldConfigManager = ComponentAccessor.getComponent(FieldConfigManager.class)
can you try with this
FieldConfigManager fieldConfigManager = ComponentAccessor.getOSGiComponentInstanceOfType(FieldConfigManager.class)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i have update my anser can you try with that!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor;
if (fieldConfigId != null)
{
FieldConfigManager fieldConfigManager = ComponentAccessor.getComponent(FieldConfigManager.class);
fieldConfig = fieldConfigManager.getFieldConfig(fieldConfigId);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Now I am getting error
ComponentAccessor has not been initialised.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are writing a Java plugin, right? Are you sure you are not trying to inject ComponentAccessor anywhere?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you share your code so we can check what is wrong!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doing it this way in my SpringBoot application I always get an exception that the ComponentAccessor is not initialized.
ComponentAccessor has not been initialised.
Can anybody tell me what I have to do that the ComponentAccessor will be properly initialized in a SpringBoot environment? Finally, I want to access the CustomFieldManager to work upon CustomFields...
...
customfieldMap.forEach((k, v) -> {
CustomFieldManager cfm = ComponentAccessor.getComponent(CustomFieldManager.class);
CustomField cf = cfm.getCustomFieldObjectByName(k);
System.out.println(cf.getValue((com.atlassian.jira.issue.Issue)v));
...
}
...
I get this exception even when I explicitely autowire the ComponentAccessor with
private ComponentAccessor componentAccessor;
public void setComponentAccessor(final ComponentAccessor componentAccessor) {
this.componentAccessor = componentAccessor;
}
...but the ComponentAccessor should be accessed in a static way anyway, shouldn't it!?
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.