Plugin to update a Jira Table

Adolfo Casari
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2015

I would like to offer a menu option for admins in JIRA to update a table in Jira DB related to Service Desk.

Any open source repo or link to a plugin tutorial that could cover this?

Thanks in advance,

2 answers

1 accepted

0 votes
Answer accepted
Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2015

 

  1. create a simple webwork action which is supposed to execute the update task.
    https://developer.atlassian.com/jiradev/jira-architecture/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/webwork-plugin-module
    https://developer.atlassian.com/jiradev/jira-architecture/jira-technical-overview/jira-webwork-actions
    you dont have to define and write vm templates. All you need is to wire up an action class which is going to handle the update operation in its execute() method.
  2. create web item in admin menu.
    https://developer.atlassian.com/jiradev/jira-architecture/web-fragments/administration-area-locations
    link that webitem to your webwork action (1).

 

Action Logic:

There is no way to write to a table of some other plugin using JIRAs db interface Active Objects because AO is sandboxed. There are however several ways to use components of other plugins, which write, read and update those tables. We can assume that if there is a table, there must be some component which manages it.

so in example if you have a table which contains Service Desk information there is probably some Manager which can write, read and update that table. The main task would be to make that Manager available in your action.

If the components of SD plugin are public and have an interface (very likely) then one could use the component-import mechanism to get them into your own plugin.

https://developer.atlassian.com/jiradev/jira-architecture/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/component-import-plugin-module

https://answers.atlassian.com/questions/198581

If this cannot be worked out, one could consider to set up a pluginArtifact.

https://developer.atlassian.com/docs/developer-tools/working-with-the-sdk/about-amps-build-options/amps-build-configuration-reference#AMPSBuildConfigurationReference-pluginArtifacts

https://developer.atlassian.com/docs/developer-tools/working-with-the-sdk/about-amps-build-options/amps-build-configuration-reference#AMPSBuildConfigurationReference-bundledArtifacts

However that means a hard dependency between both plugins. Meaning that your plugin wont be able to activate, if SD plugin is not activated already.

Adolfo Casari
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2015

Thanks a lot, this will get me started.

1 vote
Daniel Wester
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2015

If you're wanting to update data for another add-on you'll need to use it's public api. Otherwise you'll cause issues with caches and events etc. Do not go directly to the database.

Adolfo Casari
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2015

Unfortunately JSD doesn't have an API yet (https://jira.atlassian.com/browse/JSD-107). The table I mean holds just the name and description of the service desk you have.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 13, 2015

Doesn't matter, you should not write to the table.

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2015

while its legal what Daniel Wester said, i think its worth trying. It may cause problems, but must not.

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2015

Suggest an answer

Log in or Sign up to answer