Plugin to update a Jira Table

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

This widget could not be displayed.

 

  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.

Thanks a lot, this will get me started.

This widget could not be displayed.
Daniel Wester Community Champion Jun 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.

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.

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

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

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

146 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you