I'm trying to write a Jira plugin. Now I want to acess the database with DatabaseAccessorImpl but that class can't be resolved. I opened the project with IDEA and looked at com.atlassian.jira.database but it only has 4 classes. The docs say there should be DatabaseAccessorImpl here but I only have DatabaseAccessor. I have API version 7.13.0
Hi @Frieder Hannenheim welcome on the community.
Jira uses OSGi as framework which solves dependencies between components. It also provides two maven dependencies
I guess, you have configured jira-api to be part of your maven configuration and it is correct as you should not use jira-core if not necessary.
So you really need to use com.atlassian.jira.database.DatabaseAccessor which is part of public API (it is an interface which you can use to call implementation in com.atlassian.jira.database.DatabaseAccessorImpl)
I was able to get a Database connection with ConnectionFactory but now I get a
java.sql.SQLSyntaxErrorException: (conn=36516) SELECT command denied to user 'username@hostname' for table 'AO_9F39CD_TLFIELDVALUE'
which is weird because the user has all permissions in the Database. Do I need to provide a Password? Heres's my code:
java.sql.Connection connection = ConnectionFactory.getConnection("defaultDS");
Statement s = connection.createStatement();
ResultSet result = s.executeQuery("SELECT\n" +
"max(anb.FIELDVALUELONG) as lastAccountNumber\n" +
"FROM \n" +
"et1_jira.AO_9F39CD_TLFIELDVALUE anb \n" +
"WHERE \n" +
String.format("anb.FIELDCODE='%s'", fieldcode));
I'm trying to access data from another plugin. Is that not possible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, user and password is configured in your dbconfig.xml file. I just found out you want to get data for CRM App. On Server and DC it has some REST API documented. It is standard way of how to interact with the application:
https://wiki.teamlead.ru/doc/crmjs/latest/developer-s-guide/crm-api
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. I looked at the API briefly and thought I couldn't use it. Now I found a way that is slower than direct database access but still works fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.