I am trying to pull only certain worklogs for a certain issue based on the date the worklog was created. I am using the PDF View Plugin to create a report and I need to get an issue's worklogs.
Below is a snippet of code I'm using to create a series of plot points to be used in a line graph.
actualSeries = new TimeSeries("actual")
def totalRemainingEstimate = totalOriginalEstimate
actualSeries.add(preDate, totalRemainingEstimate)
def worklogManager = ComponentAccessor.getWorklogManager()
for (date in startDate..now) {
def timeSpent = 0
def currDate = new Day(date)
issues.each {
List worklogs = worklogManager.getByIssue(it)
for (def worklog : worklogs) {
def created = new Day(worklog.getCreated())
if (created == currDate) {
timeSpent += (worklog.getTimeSpent()/3600)
}
}
}
totalRemainingEstimate -= timeSpent
actualSeries.add(currDate, totalRemainingEstimate)This code works correctly and it does what I need it to, but is there a way to only pull the worklogs for an issue based on a particular date instead of pull ALL worklogs? It's unnecessary to pull all of the worklogs and I think it's extra work for the system to pull all worklogs instead of just the ones that I need.