Is there a way to store custom fields values in jira Home directory file , that already exists?

yassine March 22, 2023

Hello , i really need an idea for this one.

I want to read and edit files that are in jira home directory , using my java plugin 

  • Thanks

1 answer

0 votes
Radek Dostál
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.
March 22, 2023

https://docs.atlassian.com/DAC/javadoc/jira/reference/com/atlassian/jira/config/util/JiraHome.html which can be used to get paths or files.

 

What I'm sceptical of is the need to do anything with homes. Nothing stops you from creating or using the files, but the db is generally the better place to store stuff, and far more performant than working with files, especially large ones.

 

In one of my plugins I'm caching things with this:

ComponentAccessor.getComponent(JiraHome.class).getHomePath()

 

I don't remember if I had problems injecting the class to the constructor, but at least this method works for sure.

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.
March 22, 2023

I'm with Radek on this - it's better to store data in the database.

Scriptrunner does a bit of this though - it can store scripts on the file system.  But we tend only to use that when we are doing version control on our scripts (they're kept in a git repo somewhere).  We've got an open improvement for integrating git into the UI so that we can stop using files on the disk.

Suggest an answer

Log in or Sign up to answer