You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Overview

In its initial versions, the Workload Report provided by Minyaa Time plugin was able to aggregate :

  • Worklog details (Worklog Type, Author, Worklog Body)
  • Issue details :
    • System fields
    • Custom fields

See Worklog Reports Conceptsfor more details.

Basically, for custom fields, the aggregation was done with the raw value of the custom field converted in text as aggregated value as well as displayed value. In case of custom field implemented by CustomFieldType of Third Part Plugin, the same mechanism was applied, but the result was not always as expected, by example with nFeed.

With the introduction of the plugin "Alkaes Issue Selector and Computed Fields", the raw value for Issue Selector custom field is the Issue Id, but it had no sense to use it as displayed value.
Only the plugin itself knows how to render the field.

It is why it has been decided to provide a new module type where Third Part plugins will be able to provide their own class in charge of rendering correctly the value : the ReportElementTranslator.

Prerequisites

You will need to follow below prerequisites :

  • Have some basis knowledge on how to build a JIRA Plugin. Take time to read Building JIRA add-ons.
  • Understand that :


Module Types provided for Third Part Aggreagtion

To allow to develop your own ReportElementTranslator, Minyaa Time provides a new Module Types :
<report-element-translator /> : It allows to define a new ReportElementTranslator

Your Worklog Field Plugin step by step ..

Step 1. Create the plugin skeleton

Here, you will create your plugin skeleton with your preferred solution :
- by using the Atlassian SDK : See the Atlassian's documentation,
- or manually, if you are aware of its content

Step 2. Update your Maven POM ...

... related the dependencies
In terms of dependencies, you will need to append Minyaa Time (here for JIRA 7.3.x using Minyaa Time 1.17)
Dependencies in atlassian-plugin.xml

... related the Maven JIRA Plugin
Since the components implemented in your plugin will have to be loaded by Minyaa Time, you will have to make them exportable.
Here, we assume that your ReportElementTransator has com.yourcompany.jira.report.element as package.
Import/Export in atlassian-plugin.xml


Step 3. Create your Worklog Fields Classes

Then, you will have to develop your first ReportElementTranslator class ...
Interface ReportElementTransator
Minyaa Time provides the below ReportElementTranslator interface
Interface fr.alkaes.myaatm.report.element.ReportElementTranslator

and also an abstract implementation : fr.alkaes.myaatm.report.element.AbstractReportElementTranslator.
When you will implement your own ReportElementTranslator, you WILL HAVE TO use it.


Step 4. Configure your Modules in Atlassian Descriptor
When you have implemented all ReportElementTranslator, you will have to complete the configuration of the Atlassian Descriptor (atlassian-plugin.xml) of your plugin.
You will have to use the module-types previously mentioned ...

ReportElementTranslator Classes Declaration

The <report-element-translator /> module type allows you to declare your ReportElementTranslator classes. They will be injected in the Log Work Page and Log Work Issue Panel as soon as the plugin is enabled.
Attributes / Elements
Name Required Description
key (tick) The unique identifier of the plugin module. It is used to build the Id for the HTML Form in Log Work Page
name (tick) A simple Human readable name of the plugin module
customfield-type-key (tick) The complete key (Plugin Key and Module Key) of the customfieldtype
class (tick) The Java class which implements this ReportElementTranslator. The class you need to provide must inherit from fr.alkaes.myaatm.report.element.AbstractReportElementTranslator and implement fr.alkaes.myaatm.report.element.ReportElementTranslator.

Sample Declaration
ReportElementTranslator module in atlassian-plugin.xml
<report-element-translator key="ReportElementTranslatorOnMyCustomfieldType" name="ReportElement Translator On My CustomfieldType"
customfield-type-key="com.mycompany.muplugin:myCustomfieldType"
class="com.yourcompany.jira.report.element.ReportElementTranslatorOnMyCustomfieldType"
/>

Step 5. Build and Deploy
As soon as the declaration of ReportElementTranslator is done, you have to compile the plugin.
It will be ready for deployment with Minyaa Time plugin as dependency.




  • No labels