How to integrate JIRA REST API with Java application

I need help with implementing JIRA REST API in my Java project to retrieve worklog data. I’ve been going through the official documentation but I’m stuck on some fundamental setup questions.

First, what dependencies do I need to add to my Maven pom.xml file to work with JIRA’s REST API? Are there specific libraries I should include?

Second, for extracting worklog information specifically, would you recommend using the REST API approach or is there a better Java-based solution?

I’m also looking for any good tutorials, guides, or resources that explain the basics of connecting to JIRA through Java. Any recommendations would be really helpful.

Thanks for any advice you can share!

Integrating the JIRA REST API with your Java application can be straightforward with the right tools. I recommend including Apache HttpClient for handling HTTP requests and Jackson for parsing JSON data. While the com.atlassian.jira:jira-rest-java-client-core library simplifies the process, it’s not mandatory. For retrieving worklog data efficiently, use the endpoint ‘/rest/api/2/issue/{issueKey}/worklog’. To enhance your security, consider using API tokens instead of basic authentication. Begin by retrieving the relevant issues, and once you are comfortable, proceed with extracting the worklog information.

hey benmoore, i totally feel u! the jira-rest-java-client dep is a must. also, don’t forget to check your auth setup, whether it’s oauth or basic, it’s super crucial for a smooth connection. good luck with your project!

Integrating JIRA’s REST API with Java can be challenging initially, especially regarding authentication. It’s essential to include dependencies like Apache HttpClient and a JSON handling library such as Jackson or Gson in your Maven configuration. While Atlassian offers an official client library, I find it somewhat restrictive for more complex use cases, so I would recommend working directly with the REST API. This approach offers greater control for accessing worklog data. Additionally, keep in mind the potential issue of pagination with large datasets, as it can complicate your data retrieval process. Their developer documentation has also seen improvements lately, making it a valuable resource for examples and guidance.