mikebowler / jirametrics

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

Blocked time for ActionableAgile #28

Closed SimoneCusimano closed 5 days ago

SimoneCusimano commented 1 month ago

It would be useful to be able to export the block information in order to import it into Actionable Agile (AA).

Here are the specifications that AA expects. Is there a way to add them to the CSV exported with the tool? I can't see if I can exploit the methods within the issues class

mikebowler commented 1 month ago

This should do what you want. Note that I'm not familiar with how Actionable Agile displays the blocked information so I haven't been able to verify if it's doing the right thing. All I can say is that the CSV appears to be correct.

Also, the documentation for the blocked field says that an item that is blocked and unblocked on the same day should show as unblocked, but jirametrics will show that as blocked.

columns do
  write_headers true

  string 'ID', key
  string 'link', url
  string 'title', summary
  column_entry_times
  integer('Blocked Days', lambda do |issue|
    first_day = project_config.time_range.begin.to_date
    last_day = project_config.time_range.end.to_date
    results = issue.blocked_stalled_by_date(
      date_range: first_day..last_day,
      chart_end_time: project_config.time_range.end
    )
    blocked_days = 0
    first_day.upto(last_day) do |day|
      blocked_days += 1 if results[day].blocked?
    end
    blocked_days
  end)
  string('Blocked', lambda do |issue|
    end_time = project_config.time_range.end
    issue.blocked_on_date?(end_time.to_date, end_time: project_config.time_range.end) ? 'yes' : 'no'
  end)
end

Note that you'll need to be on the prerelease of 2.4 which I just deployed. You can install that with gem install jirametrics --pre

Let us know if that does what you want.

SimoneCusimano commented 3 weeks ago

Thanks Mike. It's what I was looking for.