Problem:
Not able to add the issue watcher custom field(Bug Watcher Notifications app provided by METAINF) on my custom screen.
However, this field is visible on the native create and edit screens. I am looking for the same functionality in my custom screen.
I have created the custom field based on the below document.
https://metainf.atlassian.net/wiki/spaces/BWN/pages/66093099/Issue+Watchers+Custom+Field
Note that, I am able to render the Jira native and custom fields using the below code:
Interface: FieldScreenRenderLayoutItem
method : getCreateHtml(webwork.action.Action action, OperationContext operationContext, Issue issue, Map<String,Object> displayParams)
ERROR stack trace in the logs:
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:877)
at com.google.common.cache.LocalCache.get(LocalCache.java:3951)
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4964)
at com.atlassian.jira.issue.watchers.DefaultWatcherManager.getWatcherUserKeys(DefaultWatcherManager.java:167)
at com.atlassian.jira.issue.watchers.DefaultWatcherManager.getCurrentWatcherUsernames(DefaultWatcherManager.java:119)
at sun.reflect.GeneratedMethodAccessor1041.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
at com.sun.proxy.$Proxy125.getCurrentWatcherUsernames(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1041.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:131)
at com.sun.proxy.$Proxy125.getCurrentWatcherUsernames(Unknown Source)
at com.metainf.jira.plugin.watch.field.IssueWatchersField.getVelocityParameters(IssueWatchersField.java:113)
at com.atlassian.jira.issue.customfields.CustomFieldUtils.buildParams(CustomFieldUtils.java:396)
at com.atlassian.jira.plugin.customfield.CustomFieldTypeModuleDescriptorImpl$2.call(CustomFieldTypeModuleDescriptorImpl.java:177)
at com.atlassian.jira.plugin.customfield.CustomFieldTypeModuleDescriptorImpl$2.call(CustomFieldTypeModuleDescriptorImpl.java:172)
at com.atlassian.ozymandias.SafePluginPointAccess.call(SafePluginPointAccess.java:390)
at com.atlassian.jira.plugin.customfield.CustomFieldTypeModuleDescriptorImpl.getSupplierValueOrHtmlErrorMessage(CustomFieldTypeModuleDescriptorImpl.java:372)
at com.atlassian.jira.plugin.customfield.CustomFieldTypeModuleDescriptorImpl.getEditHtml(CustomFieldTypeModuleDescriptorImpl.java:172)
at com.atlassian.jira.issue.fields.ImmutableCustomField.getEditHtml(ImmutableCustomField.java:890)
at com.atlassian.jira.issue.fields.ImmutableCustomField.getCreateHtml(ImmutableCustomField.java:876)
at com.atlassian.jira.issue.fields.screen.AbstractFieldScreenLayoutItem.getCreateHtml(AbstractFieldScreenLayoutItem.java:68)
at com.atlassian.jira.issue.fields.screen.FieldScreenRenderLayoutItemImpl.getCreateHtml(FieldScreenRenderLayoutItemImpl.java:42)
Please suggest or help me so that I can render the issue watcher custom field on my custom screen.
Thanks,
Kiran. M