Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Retrieving Full Project History Using Jiraone REST API #134

Open
aamiryousuf opened this issue May 8, 2024 · 1 comment
Open
Assignees
Labels
question Further information is requested

Comments

@aamiryousuf
Copy link

Hello,

I am currently utilizing the Jiraone REST API for extracting project history, which has been incredibly useful. However, I'm encountering a limitation with projects that contain extensive data. Specifically, I'm only able to retrieve history data up until last year, and not all details are being pulled.

Below is the Python script I'm using. I'm exploring whether there's a way to fetch the complete history, or, if data volume is an issue, to selectively specify certain fields within the history to retrieve all relevant changes. Alternatively, could I implement a date range to segment the output into manageable chunks? Another possibility I'm considering is whether there's an alternative to using PROJECT.change_log for this purpose.

I appreciate any guidance you can provide, as I'm relatively new to both Jira and Python.

from jiraone import LOGIN, PROJECT

# User credentials and Jira instance URL
user = "my_email"
password = "my_Token"
link = "My_DC_URL"

# Log into the Jira instance
LOGIN.api = False
LOGIN(user=user, password=password, url=link)

# Main execution
if __name__ == '__main__':
    # the output of the file would be relative to the directory where this python file is executed
    jql = "issuekey in (ID-54145)"  # A valid JQL query
    PROJECT.change_log(jql=jql)

Thanks for your assistance,

Aamir
@princenyeche princenyeche self-assigned this May 9, 2024
@princenyeche princenyeche added the question Further information is requested label May 9, 2024
@princenyeche
Copy link
Owner

Hey @aamiryousuf

If you're not getting all the data, it depends on what level of access you have to the project. The method uses JQL, so if no errors are being returned to you, it is safe to assume that, the data gotten is what it could fetch from the search or the entire data contained available to your permission. The change_log method will pull out the history synchronously from your Jira site but it can have performance issues if the data being pulled is a lot. You might want to try the asynchronous method async_change_log to see if there's any difference in the data pulled by both.

# import statement
PROJECT.async_change_log(
               jql, folder="TEST", file="sample.csv", flush=20
            )

This method allows multiple extraction quickly and should extract everything. When using JQL, you can specify a date range as that's JQL's ability to filter your search criteria. I suggest using that if you want to limit the search range. If both are the same, then you might want to check how many issues are actually returned based on your JQL or if those issues actually have historical content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants