Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Programming new Plugin connection to Jira Database

Hello all,

Imnew to Atlassian Developing and for a Project we have to develop a plug in that connects to the JIRA Database.
Im at a loss after scouring the Internet, I cannot seem to find a fitting solution.
Can you give me some ideas which classes to use in the JIRA rest API?

Thanks! 

1 answer

0 votes

Possibly.

First, we need to know what type of coding you are doing.  The options are broadly:

  1. Hacking the core of JIRA (To be avoided.  It leaves you unsupported and hard to upgrade, maintain, debug or change)
  2. Writing a type-2 plugin, which will be installed into a JIRA system and has direct access to the internal java APIs (JIRA Server only)
  3. Writing a Connect add-on, which will be installed into a JIRA system, but uses REST to do the work (JIRA Cloud only)
  4. Writing an external thing that runs outside JIRA and uses REST to do the work

I'm guessing you mean 2 or 3, but they make a bit less sense if we don't explain the full range.

Also, don't say "database" - you don't want to code for access to the database, it's not sane.  Always go through the APIs.

Hello Nic,

Thank you for your Answer. I think my Plugin would fall under number 2 of your description.

How would I go about it through the API?
I searched on google but could not find a fitting answer.

Do what?  You haven't explained what your add-on is going to do.  You've just said "connect to the database" which is, quite simply, the wrong way to approach doing things in JIRA.

Could you describe what your add-on is aiming to do, in terms of what the users might see or get?

The goal is to connect to the db, pull two numbers out, and create the sum and average value of these two numbers and then export the results to txt and pdf.
My job in this is only to realize the db connection to access the numbers.
This Project is part of a group project in which we are practicing Scrum, and creating a plugin for Jira.

Right.

Do not do it with a database connection.  It is the wrong approach.  Use the API.

What are these numbers?

These numbers are just dummy variables. The goal is to program a plugin that gathers information from the JIRA db about issues, progress, etc. and enable the user to generate reports.
My job is to implement the link between the report generation and the JIRA db.
How could I realize this with the API? All examples I found so far do not work because the imports cannot be resolved.

If your imports aren't resolving, then the code is broken (although I know getting the imports right are a pain when writing add-ons for Atlassian stuff).  It's worth going into a bit more detail I think.

Also, you probably need to define the questions you're looking to answer. 

If you really want totally open-ended reporting, then I'd lean toward moving to a database tool instead of trying to read the JIRA database in the application.  It's not built for reporting, but it can be used, especially if you use a product that understands the JIRA database would be best.  (I tend to avoid open-ended reporting - it usually leads to users coming to you to "explain why this report tells me X" and you spend hours working out that their reporting was built by the clueless and it's nonsense!)

If you want this reporting inside JIRA though, then definitely need to fix your imports!  Even if you weren't working with the API much, you'll still have problems.

How would I go about fixing the imports?
For example:
import com.atlassian.jira.rest.client.api.JiraRestClientFactory;
isn't resolving. (As are a bunch of other ones).

Well, that's no surprise.  JRJC is for coding something that runs outside JIRA, it can't be imported into an add-on because it's external (and add-ons simply don't need it - they already have access to the API)

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Happy New Year and Welcome New Marketplace Partner Program Partners!

Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...

641 views 7 23
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you