Methods

Intelligent Reports provides methods for some objects to provide additional functionality to transform the object.

Datetimes

Intelligent Reports provides the following methods for datetime objects. A datetime object represents a specific point in time on a specific date.

Some JIRA fields are date objects only, they do not have an associated time. Use the datetime function to convert these dates into datetimes to use the following methods on them.

format

The format method on date objects allows you to format a date into a string in your preferred date and time format. The formats supported are those supported by the Joda time library for Java. You can see the supported formats here.

now().format("YYYY")
now().format("d MMMM YYYY")
now().format("YYYY-MM-dd")
now().format("hh:mm d MMMM")

before

The before method on date objects allows you to test if a datetime is before the specified date. The single argument is the date to test against. The return value is true if the argument is before the date, false otherwise.

now().before(now().endOfDay())

after

The after method on date objects allows you to test if a datetime is after the specified date. The single argument is the date to test against. The return value is true if the argument is after the date, false otherwise.

now().after(now().startOfDay())

addDays

The addDays method on date objects allows you to add or subtract a number of days from the date. The single argument is a number of days to add; you can provide a negative number to subtract days.

now().addDays(1)
now().addDays(-7)

addMonths

The addMonths method on date objects allows you to add or subtract a number of months from the date. The single argument is a number of months to add; you can provide a negative number to subtract months.

now().addMonths(1)
now().addMonths(-6)

addYears

The addYears method on date objects allows you to add or subtract a number of years from the date. The single argument is a number of years to add; you can provide a negative number to subtract years.

now().addYears(1)
now().addYears(-1)

startOfDay

The startOfDay method on date objects allows you to get the date representing the start of the day, effectively setting the time component of the date to midnight.

now().startOfDay()

endOfDay

The endOfDay method on date objects allows you to get the date representing the end of the day, effectively setting the time component of the date to one second before midnight.

now().endOfDay()

startOfMonth

The startOfMonth method on date objects allows you to get the date representing the start of the month, effectively setting the time component of the date to midnight, and the day of the month to the first.

now().startOfMonth()

endOfMonth

The endOfMonth method on date objects allows you to get the date representing the end of the month, effectively setting the time component of the date to one second before midnight, and the day of the month to the final day in the given month.

now().endOfMonth()

startOfYear

The startOfYear method on date objects allows you to get the date representing the start of the year, effectively setting the time component of the date to midnight, and the date to the first of January.

now().startOfYear()

endOfYear

The endOfYear method on date objects allows you to get the date representing the end of the year, effectively setting the time component of the date to one second before midnight, and the day of the month to the 31st of December.

now().endOfMonth()
Still have questions? Contact our friendly support team, we are here to help!