REST API

It is possible to access report data via REST call to a JIRA endpoint introduced by Time in Status. The parameters of the REST call correspond to Time in Status report parameters explained above.


Rest Call Format

The rest call should be made in the following format

<base_url>/rest/tis/report/1.0/<format>?filterType=<filterType>&<user|projectKey|jqlFilterID>=<selection>&columnsBy=<columnsBy>&fields=<fields>&statuses=<statuses>&groups=<groups>&includeDeletedStatuses=<includeDeletedStatuses>&startDate=<startDate>&endDate=endDate&dateRangeField=<dateRangeField>&calendar=<calendar>&viewFormat=<viewFormat>&outputType=<outputType>&dateFormat=<dateFormat>&dateTimeFormat=<dateTimeFormat>


Parameters


Token
Description
Required
Value Samples
base_urlThe baseURL of your JIRA instance.Yes
  • http://192.168.0.71:7500/jira75/
  • https://myjiraserver/jira
outputType

The output file format of the report. Possible options are:

  • xls = Returns an Excel file in XLS format
  • xlsx = Returns an Excel file in XLSX format
  • csv = Returns a CSV (comma separated value) file
Yes
  • xls
  • xlsx
  • csv
filterType

Defines how the issues to be included in the report will be selected. Possible options are:

  • user = Report will filter out the issues assigned to the selected user
  • project = Report will filter out issues in the selected Jira project
  • advanced = Report will filter out issues based on an existing JQL filter
Yes
  • user
  • project
  • advanced
selection

Defines the value that will be used to filter the issues. This parameter depends on reportType selection.

  • If reportType is user, system expects a user name in the form "user=<some_user_name>"
  • If reportType is project, system expects a project key in the form "projectKey=<project_key>"
  • If reportType is advanced, system expects a JQL filter ID in the form "jqlFilterID=<jqlFilterID>"
Yes
  • user=admin
  • projectKey=ABC
  • jqlFilterID=10145
columnsBy

Defines the column structure of the report. Possible options are:

  • statusDuration = Report will show durations spent on each status as columns
  • assigneeDuration= Report will show durations spent on each assignee as columns
  • groupDuration= Report will show consolidated durations spent on members of each group as columns
  • statusCount = Report will show counts for each status
  • transitionCount = Report will show counts for each transitions between statuses
Yes
  • statusDuration
  • assigneeDuration
  • groupDuration
  • statusCount
  • transtitonCount
fields

The IDs of fields (separated by commas) on JIRA Issue that will be added to report output as columns.

Both system and custom fields are supported.


assignee,customfield_10020,customfield_10007,description,duedate, fixVersions
statuses

The IDs of statuses of which the durations will be included in the report.

System expects you to provide existing status IDs. It is possible to leave this parameter empty but then the report will include issue rows without any duration columns.

For assignee based reports, durations of unselected statuses will be excluded from durations of assignee columns.

If not provided, the report will include all statuses in issues' histories.


  • 3,10000,10001
groups

The names of user groups (separated by commas) that will be included in Group Time report.

If not provided or empty, the report will included all durations in a column named "Not a member of selected groups"


  • jira-administrators
  • jira-users, jira-administrators
includeDeletedStatuses

Sets whether included statuses in issues' histories will be included in the report or not:

Possible options are:

  • true
  • false

In not provided, "true" is assumed.


  • true
  • false
startDateThe start date of report interval in "yyyy-MM-dd" or "yyyy-MM-dd hh:mm" format.
If time parameter is no given default time "00:00" will be process
Yes2017-07-01 00:00
endDateThe end date of report interval in "yyyy-MM-dd" or "yyyy-MM-dd hh:mm" format.
If time parameter is no given default time "00:00" will be process
Yes2017-08-31 23:59
dateConditionField

The dateConditionField type that startDate and endDate parameters will be based on. Possible options are:

  • created = The startDate and endDate parameters will be used to filter issues based on issue create date.
  • updated = The startDate and endDate parameters will be used to filter issues based on issue last update date.
  • resolved = The startDate and endDate parameters will be used to filter issues based on issue resolution date.
Yes
  • created
  • updated
  • resolved

calendar

The calendar that report durations will be calculated based on. Possible options are:

  • normalHour = The durations will be based on a 7/24 calendar.
  • businessHour = The durations will be based on the business calendar defined in admin settings. Each day will be 24 hours.
  • businessDay = The durations will be based on the business calendar defined in admin settings. Length of each day will also be based on business hours defined in admin settings.
Yes
  • normalHours
  • businessHours
  • businessDays
viewFormat

The format of duration data in the report. Possible options are:

  • humanReadableFormat = The values will be shown like "44 d 5 h 2 m 35 s"
  • ddhhmmssFormat = The values will be shown like "44:05:02:35"
  • hhmmssFormat = The values will be shown like "1061:02:35"
  • daysFormat = The values will be shown with a single decimal value like "44.21"
  • hoursFormat = The values will be shown with a single decimal value like "1061.04"
  • minutesFormat = The values will be shown with a single decimal value like "63662.59"
  • secondsFormat = The values will be shown with a single decimal value like "3819755"
Yes
  • humanReadable
  • ddhhmmss
  • hhmmss
  • days
  • hours
  • minutes
  • seconds
dateFormat

The string format to use for displaying values of fields of type Date

Default JIRA date format is used if parameter is empty of missing.

You can refer to the Java Documentation for more information about Date Format Strings.


  • yyyy-MM-dd
  • dd/MM/yy
  • dd/MMM/yyyy
dateTimeFormat

The string format to use for displaying values of fields of type DateTime

Default JIRA datetime format is used if parameter is empty of missing.

You can refer to the Java Documentation for more information about Date Format Strings.


  • yyyy-MM-dd hh:mm a
  • dd/MM/yy HH:mm
  • dd/MMM/yyyy HH:mm:ss



Examples:

http://192.168.0.71:7500/jira75/rest/tis/report/1.0/out/file?filterType=user&user=admin&columnsBy=statusDuration&fields=assignee&statuses=3,10000,10001&includeDeletedStatuses=true&startDate=2017-09-01 00:00&endDate=2017-10-31 00:00&dateRangeField=created&calendar=normalHours&viewFormat=minutes&outputType=xls


http://192.168.0.71:7500/jira75/rest/tis/report/1.0/out/file?filterType=project&projectKey=PMP&columnsBy=statusDuration&fields=assignee&statuses=3,10000,10001&includeDeletedStatuses=true&startDate=2017-09-01 00:00&endDate=2017-10-31 00:00&dateRangeField=created&calendar=normalHours&viewFormat=minutes&outputType=xlsx&dateFormat=yyyy-MM-dd&dateTimeFormat=yyyy-MM-dd hh:mm a


http://192.168.0.71:7500/jira75/rest/tis/report/1.0/out/file?filterType=advanced&jqlFilterID=10004&columnsBy=statusDuration&fields=assignee&statuses=3,10000,10001&includeDeletedStatuses=true&startDate=2017-09-01 00:00&endDate=2017-10-31 00:00&dateRangeField=created&calendar=normalHours&viewFormat=minutes&outputType=csv&dateFormat=yy-MM-dd&dateTimeFormat=yyyy-MM-dd HH:mm:ss


Return

The REST call returns an XLS, XLSX or CSV file that contains all the data in the report.


  • No labels