Manipulating with JIRA entities from a plugin component

I am creating a plugin which will have a scheduled job inside periodically synchronizing jira database with 3rd party software. So all the routines will be performed in background.

It will be required to perform the following set of tasks:

1) Search for issues / projects / versions / jira users by certain search criteria

2) Create new / Update existing issues / projects /versions / jira users

All the changes performed by the plugin should be visible in "Recent Activity" like it was done directly by users.

Which internal Jira API(s) I need to use within my plugin to achieve the goals? Which is the best practice to perform this task?

10 answers

This widget could not be displayed.

Well I do not need too detailed explanations. I would like to find out if there is a separate API for Jira DB manipulation and where can I read for this. I.e. which can provide me the interface to access all jira entities.

As for example you mentioned JqlQueryBuilder and IssueService but I don't only need to deal with issues but also with projects, versions and users.

I searched over the docs and questions database but can't find anything suitable.

This widget could not be displayed.

Use OfBizDelegator. You will find all the methods in the Java docs. There is a chapter for working with DB in JIRA Development Cookbook.

This widget could not be displayed.

You're unlikely to get a good answer with such a broad question. Start with JqlQueryBuilder, IssueService, etc etc.

This widget could not be displayed.

In that case, ProjectManager, ProjectVersionManager, and UserManager/UserAccessor. Of course, you can go direct to the DB as well.

This widget could not be displayed.

Thank you Jamie and Jobin for the hints. The picture is getting clearer now.

So as far as I see I have 2 ways:

1) Use OfBiz Entity Manager to work directly with jira database

2) Use Managers for every kind of JIRA data I need to deal with

Could you, please, highlight the biggest pros and cons of both approaches as I am on crossroads and need to choose the best way or it may cost much if I will discover some restriction in the middle of the road.

This widget could not be displayed.

But what about Jobin's OfBizDelegator - seems quite competitive alternative.

This widget could not be displayed.

You don't want to be writing to the database directly, so if you need to create <anything> in jira, the managers etc are the only choice you have.

This widget could not be displayed.

By writing to the db I mean using OfBizDelegator to store values directly in the DB. Sometimes it's ok, but for the things you're talking about, it's not. Unless you want to tear your hair out dealing with problems involving the caches and referential integrity. Really, there is only one way to do this.

This widget could not be displayed.

Thanks Jamie for clarification, this definitely makes sense for me.

This widget could not be displayed.

I agree with Jamie. Use OfBizDelegator only when you know all the DB Entity relations. It is advised to use manager classes if possible and use delegator only if that is not an option.

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 Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

190 views 18 7
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