I am developing custom reports for JIRA and want to set a category on the reports I am making. I found that adding a <category key="[REPORT CATEGORY]" /> element inside the report element in the atlassian-plugin.xml file sets the category for the report. However, the only keys that do not produce an error are keys that are already defined by the JIRA default reports. Whenever I put a new key, regardless of whether or not I define it in the properties file, JIRA gives an error when trying to install the plugin, and the logs say:
[atlassian.plugin.parsers.XmlDescriptorParser] There was a problem loading the descriptor for module 'report' in plugin 'Distribución de Trabajo'.
The report module: com.processconsulting.worklogDistributionTemp:worklog-distribution specified a category key that is not a valid category: LP
com.atlassian.plugin.PluginParseException: The report module: com.processconsulting.worklogDistributionTemp:worklog-distribution specified a category key that is not a valid category: LP
The key I put was "LP", and the logs say it is not a valid category. Is there anything I have to do to add the category in JIRA before I install the plugin? Or maybe something else inside the plugin to let JIRA know that I want to define a new report category?
Community moderators have prevented the ability to post new answers.
Hi David,
I'm trying to do the same thing, but it seems it is not possible. Here is the class describing static report categories:
https://docs.atlassian.com/jira/latest/com/atlassian/jira/plugin/report/ReportCategoryImpl.html
Also, I checked the Atlassian Connect documentation for reports and it says:
Screen Shot 2016-08-16 at 5.32.59 PM.png
Actually, the hole documentation for creating report modules for JIRA server is awful!
Now I'm sure it is not possible. The report categories are hardcoded in this class of JIRA Core:
public class ReportCategoryImpl implements ReportCategory { public static final ReportCategoryImpl AGILE = new ReportCategoryImpl("agile"); public static final ReportCategoryImpl ISSUE_ANALYSIS = new ReportCategoryImpl("issue.analysis"); public static final ReportCategoryImpl FORECAST_MANAGEMENT = new ReportCategoryImpl("forecast.management"); public static final ReportCategoryImpl OTHER = new ReportCategoryImpl("other"); private static final Map<String, ReportCategoryImpl> BY_KEY; private final String key; ReportCategoryImpl(String key) { this.key = key; } public String getKey() { return this.key; } public String getI18nKey() { return "report.category." + this.key; } @Nullable public static ReportCategory byKey(String key) { return (ReportCategory)BY_KEY.get(key); } static { ImmutableList categories = ImmutableList.of(AGILE, ISSUE_ANALYSIS, FORECAST_MANAGEMENT, OTHER); BY_KEY = Maps.uniqueIndex(categories, new Function() { public String apply(ReportCategoryImpl input) { return input.getKey(); } }); } }
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.