There are 2 updates, 1 comment.
 
 
JIRA Components / cid:jira-generated-image-avatar-f7e636d5-6687-4298-8468-838b4e6d259e JIRA-133 Open

Allow extensions to add support for other kinds of JIRA instances

 
View issue   ยท   Add comment
 

2 updates

 
cid:jira-generated-image-avatar-6d45a0ae-02a3-4796-aacb-a886042743f4 Changes by Rares-Emil Bancescu on 06/Nov/26 15:13
 
Attachment: screenshot-1.png
Attachment: screenshot-2.png
 
 

1 comment

 
cid:jira-generated-image-avatar-6d45a0ae-02a3-4796-aacb-a886042743f4 Rares-Emil Bancescu on 06/Nov/26 15:13
 

Implemented in https://github.com/xwiki-contrib/jira/pull/85.

Each configured JIRA server now has an instance type (JIRA.JIRAConfigClass property instanceType). An empty value is the default type, JIRA Data Center / Server, so existing configurations don't change. The macros (jira, jiraCount and the chart macros) get their data from the connector of the server's instance type.

Extension points

An extension adding a kind of JIRA instance provides:

  • a UI extension of the org.xwiki.contrib.jira.instancetype extension point, which adds the type to the "Instance type" column of the JIRA administration. Parameters:
    • instance_type: the value stored in the configuration, also the hint of the connector;
    • translation_key: the label of the type (the type itself when missing);
    • order: the position of the type in the list;
  • a org.xwiki.contrib.jira.macro.JIRAConnector component whose hint is the instance type (searchIssues, countIssues, fetchGadgetData). The formats it returns (the <item> elements read by the displayers, and the gadget JSON of each chart) are documented in its javadoc;
  • optionally, <key>.<instanceType> translations of the basic authentication fields (e.g. jira.config.auth.basicAuth.username.cloud), to relabel them for that type (e.g. "Email" / "API token").

Behaviour

  • The "Instance type" column is only displayed when an extension contributes a type, or when a server uses a type whose extension isn't installed anymore. The administration is unchanged otherwise.
  • A server whose instance type has no connector (e.g. the extension was uninstalled) keeps its type, displayed as "(not available, the extension providing it may be missing)", so saving the configuration doesn't change it. Its macros display an error instead of falling back to the default connector.
  • The new API is @since 11.2.0 and @Unstable.

With an extension contributing a "Cloud" type:
_thumb_45864.png

When that extension is uninstalled:
_thumb_45865.png