Hi,
I have structure where all the tickets are grouped by assignee: I want to check when the resource is free
def jqlQuery = "due is not EMPTY" Query query = jqlQueryParser.parseQuery(jqlQuery) def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter()) // Find the maximum due date def maxDueDate = results.results.collect { it.dueDate }.max() def today = new Date() def daysRemaining = maxDueDate ? (maxDueDate - today).days : null // Return the desired message if (daysRemaining == null) { return "Free" } else if (daysRemaining >= 0) { return "Free in ${daysRemaining} days" } else { return "Free" }
I do it another way,
IF dueDate < NOW():
Round((NOW() - dueDate)/(1000 * 60 * 60 * 24)) CONCAT " days being free"
ELSE IF dueDate == NOW() + 1:
"Free today"
ELSE
Round(dueDate - NOW()/(1000 * 60 * 60 * 24)) CONCAT " days to be free"
If it is against the ticket it gives my the correct days since the resource is free or will be free but against Assignee its not giving me correct value .
Against Abdul Haseeb it should tell me 22 days to be free .. as his last day task due date is 30 July.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.