Our instance uses a modified version of Adaptavist's Round Robin Script. In the code block that pulls the last issue with an assignee, I changed it to pull 'Defect' issues that have an assignee and also a value in a custom field called 'Original Assignee':
def lastIssueIdWithAssignee = issueManager.getIssueIdsForProject(issue.projectObject.id)
.sort()
.reverse()
.find {
def foundIssue = issueManager.getIssueObject(it)
return foundIssue.assignee && foundIssue.issueType.name == "Defect" && foundIssue.getCustomFieldValue(originalAssigneeCustomField)
}
I want to add to the return statement and make it so that it pulls the last issue that fulfills the above criteria, but have it also look at the created date/time. In other words, I want it to pull the last created issue that:
- is of 'Defect' Issue type
- has an assignee
- has a value in the 'Original Assignee' custom field
and in addition...
- was created in between the times of 4:00AM - 4:00 PM UTC
Is this possible? If so, how would I translate it into code?