Find Issues added in the past 24 hours

The daily_summary.rb script searches through your projects to find and output all of the Issues you added to Dradis in the past 24 hours.

The meat of the script is the following loop:

recent_projects  = Project.where("projects.updated_at >= ? AND projects.updated_at <= ?", yest, DateTime.now)
recent_projects.each do |project|
  with_scope(project) do
    issue_library = Node.issue_library
    Issue.where(node_id: issue_library.id).where("notes.updated_at >= ? AND notes.updated_at <= ?", yest, DateTime.now).each do |issue|
      puts "* Recent Issue: '#{issue.title}'"
      puts "  Added to Project: '#{project.name}' on '#{issue.updated_at}' "
      puts " "
    end
  end
end

We cycle through each of the recent projects. For each of them, we gather all the issues that were updated in the past 24 hours with the following line:

Issue.where(node_id: issue_library.id).where("notes.updated_at >= ? AND notes.updated_at <= ?", yest, DateTime.now).each do |issue|

Then, we output each of the recently updated Issues along with the relevant Project name and the date/time stamp.

Seven Strategies To Differentiate Your Cybersecurity Consultancy

You don’t need to reinvent the wheel to stand out from other cybersecurity consultancies. Often, it's about doing the simple things better, and clearly communicating what sets you apart.

  • Tell your story better
  • Improve your testimonials and case studies
  • Build strategic partnerships

Your email is kept private. We don't do the spam thing.