mikebowler / jirametrics

A tool to extract data from Jira and either generate reports or export to CSV files
Apache License 2.0
34 stars 1 forks source link

Error in issue.load_history_into_changes #23

Closed SimoneCusimano closed 4 months ago

SimoneCusimano commented 4 months ago

I've just update to v2.0.0. I received the following error:

NoMethodError: undefined methodeach' for nil:NilClass ←[0;31m load_history_into_changes at [...]/jirametrics-2.0/lib/jirametrics/issue.rb:489`

It seems that history['items'] is nil. Could it be possible? Is there a way to find out what issue id is causing the error? If I use another board, it works perfectly.

mikebowler commented 4 months ago

It's another "theoretically impossible but we've seen it in production" moment, I think. I'll add a check for that.

Unfortunately, there is no easy way to see which issue caused the problem. That's a good suggestion though - let me see what I can do.

mikebowler commented 4 months ago

I've pushed v2.0.1 with two fixes

I'm still unclear why there would be a history item without items, but I've seen weirder things from Jira before.

Let me know if this loads for you now.

SimoneCusimano commented 4 months ago

Thanks for your work, Mike.

No exceptions are thrown now, but, unfortunately, with v2.0.1 no issues are plotted in the charts except for one that is in progress. Issues are downloaded, but not plotted.

The strange thing is that with version 1.2.1 everything was running smoothly. What more info can I give to help solve this?

mikebowler commented 4 months ago

If you take a look at the first JSON sample in this article, you'll see a well-formed Issue. https://agiletechnicalexcellence.com/2024/04/09/jira-issue-history.html

The fix that I put into 2.0.1 was because you didn't have an items section under one of the histories, which is theoretically impossible. Can you open one of the downloaded issues on your machine and see what really is in that history block?

The issues will all be under your target directory.

mikebowler commented 4 months ago

Or you had an items element but it was empty. Would have been the same error either way.

SimoneCusimano commented 4 months ago

False alarm. The fix v2.0.1 works!

Ignore my last message. In the meanwhile, someone had changed the filter of the Jira's board and so I had unexpected results.

All OK now.

Thanks again, Mike!

SimoneCusimano commented 4 months ago

Fixed

SimoneCusimano commented 4 months ago

However, is there a way to skip the download process?

When I have to do some tuning for html_export or csv files I would like to skip the download of the issues. The download process could be time consuming sometimes.

mikebowler commented 4 months ago

Yes, instead of jirametrics go, just use jirametrics export. Or download if that's the only part you want