Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Example

Code Block
languagesql
SELECT * 
FROM EXAMPLES.TIMESHEETFROMPREVIOUSMONTHTABLE(EXAMPLES.JQLTIMESHEET('RESOLUTION IS EMPTY', TIMESTAMP '2014-01-01 01:01:01', TIMESTAMP '2018-12-12 01:01:01'))

Definition

Code Block
languagesql
SELECT 
	CEILFLOOR(W.STARTDATE TO DAY) DAYOFMONTH,  WORKDAY, 
	AUTHOR, 
	COUNT(W.ID) ENTRIES,
	AUX.ASTEXT(COLLECT(AUX.ASISSUEKEY(ISSUE))) ISSUECOUNTISSUES, 
	AUX.ASDURATION(SUM(W.TIMEWORKED)) WORKED, 
	SUM(TIMEWORKED) WORKED_IN_MS 
FROM 
	CORE.WORKLOGS W 
WHERE 
	W.AUTHOR = JOIN TABLE(AUX.LOGGEDINUSER() AND EXTRACT(YEAR FROMJQL('ID',?)) JQL on JQL.ID = W.STARTDATE)ISSUE =
EXTRACT(YEARWHERE FROM CURRENT_TIMESTAMP) 
	AND EXTRACT(MONTH FROM W.STARTDATE) = (EXTRACT(MONTH FROM CURRENT_TIMESTAMP) -1) 
GROUP BY CEIL(W.STARTDATE BETWEEN ? AND ? 
GROUP BY FLOOR(STARTDATE TO DAY), AUTHOR 
ORDER BY FLOOR(STARTDATE TO DAY) ASC