I'm creating a custom plugin for Jira. I now have start date and end date fields. How can I add a field to select the user for which the report will be generated?
<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2">
<plugin-info>
...
</plugin-info>
<report name="Creation Report" ...>
<description ...>
<resource ...>
<property>
<key>startDate</key>
<name>report.issuecreation.startdate</name>
<description>report.issuecreation.startdate.description</description>
<type>date</type>
</property>
<property>
<key>endDate</key>
<name>report.issuecreation.enddate</name>
<description>report.issuecreation.enddate.description</description>
<type>date</type>
</property>
<property>
<key>users</key>
<name>report.issuecreation.users</name>
<description>report.issuecreation.users.description</description>
<type>select</type> # i don't know
???
</property>
</report>
</atlassian-plugin>
Read this documentation: https://developer.atlassian.com/server/jira/platform/object-configurable-parameters/
Then you can see some examples like this:
<properties>
<property>
<key>versionId</key>
<name>common.concepts.version</name>
<description>report.timetracking.version.description</description>
<type>select</type>
<values class="com.atlassian.jira.portal.VersionOptionalValuesGenerator"/>
</property>
<property>
<key>sortingOrder</key>
<name>report.timetracking.sortingorder</name>
<description>report.timetracking.sortingorder.description</description>
<type>select</type>
<values class="com.atlassian.jira.portal.SortingValuesGenerator"/>
</property>
<property>
<key>completedFilter</key>
<name>report.timetracking.filter</name>
<description>report.timetracking.filter.description</description>
<type>select</type>
<values class="com.atlassian.jira.portal.FilterValuesGenerator"/>
</property>
</properties>
The type select
is correct, but I believe you will need something called UserValuesGenerator, these generators basically extend com.atlassian.com.configurable.ValuesGenerator
So you can write your own UserValuesGenerator and use it.