Scripted Report development interface

Scripted Report development interface

This page is a tour of the Scripted Report editor: what each tab is for and where the controls live. It opens when you create a report from the Blank (custom code) template, when you open any scripted template from the Templates tab, or when you press Edit on a scripted report you already own.

Renamed since the previous version of this guide. The tab that used to be called General is now Fields. There is no Get Report button any more — the report is re-run with the circular Refresh icon to the left of Add to My Reports. A Preview tab has been added as the first tab.

The editor has seven tabs:

  • Preview — run the report and see the result as a viewer would.

  • Fields — declare the input parameters the user fills in.

  • Permissions — who may view, edit and administer the report.

  • Template — the HTML and CSS layout, driven by Handlebars.

  • Script — the JavaScript that fetches Jira data and shapes it.

  • Split editor — template and script side by side on one screen.

  • External editor — develop in JSFiddle or in your own IDE.

Preview tab

Preview tab with a rendered report and the Configure panel
Preview tab: the report runs with the current parameter values, exactly as a viewer sees it.

Input parameters are not part of the page body — they live in the floating Configure panel. Drag it by the handle in its top-left corner to move it out of the way, or close it with ×. After changing a parameter, or after editing the template or the script, press Refresh next to the report title to re-run the report.

Configure panel with a date range and a JQL filter
The Configure panel renders one control per field declared on the Fields tab.

Fields tab

This is where the report's input parameters are declared. Every row has three properties:

  • Name — the identifier you use in code, via SR.fields.getValueByFieldName('name').

  • Title — the label shown above the control in the Configure panel.

  • Type — what kind of control the user gets, and what shape the value arrives in.

Fields tab listing the input fields of a report
Fields tab. The tutorial report ships with two fields: a Range Picker and a JQL filter.

To add a field, choose a type in the Field Type selector and press +. Twenty types are available:

String · Number · Date · Checkbox · Textarea · Radio button · Jql · Project · User Picker · Range Picker · Fields Picker · Issue Picker · Issue Type Picker · Select List · Filter by · Attachment Picker · Sprint Picker · Timesheet Builder Team Picker · Status picker · Read Only Text

Field Type dropdown open, showing the available input field types
The Field Type list scrolls — twenty types in total.

The pencil icon opens Edit Field, where the name and the title can be changed. The type of an existing field is fixed; to change it, delete the field and add a new one. Note that the Field Type selector above the table picks up the type of the row you are editing.

Edit Field dialog with Field and Field Title inputs
Edit Field. "Field" is the identifier used in code; "Field Title" is what the user reads.

Show meta fields, on the right below the table, reveals the system fields the app maintains for the report.

Three habits that save you support tickets. Give reports and fields descriptive, unique names — a second report called "Project Status" is a recipe for confusion. Write titles that explain what the parameter does, because your users will not read the code. And assume every field can be empty: parameter validation belongs at the very top of your script.

Permissions tab

Permissions tab with visibility and permission settings
Permissions tab.

Visibility inside Jira issue panel controls where the report is offered as an issue-panel report. Other permissions is a two-part control: pick the access level (View or Edit), pick who gets it, then press Add. The table below lists every grant currently in force.

  • View — the user can open the report and run it.

  • Edit — the user can also change and save the report.

The Owner always has full access. If you transfer ownership, give yourself access in Other permissions first, or you lose access to the report.

For step-by-step instructions on sharing, see How to share reports.

Template tab

Template tab with the HTML editor
Template tab: HTML, CSS and Handlebars expressions.

The template is plain HTML and CSS plus Handlebars expressions. Values reach it through SR.render(), called from the Script tab. Beautify, at the top right of the editor, reformats the code.

Script tab

Script tab with the JavaScript editor
Script tab. The Blank (custom code) template ships with a fully commented tutorial script.

The script runs inside a top-level await scope with the SR object available, so asynchronous calls can be written synchronously. Every report must call SR.render() at least once — without it nothing is rendered, and the minimum viable script is SR.render({}).

If you need to touch the DOM after Handlebars has produced it, pass a callback as the second argument of SR.render(); it runs once the HTML is in place.

Split editor tab

Split editor showing template and script side by side
Template on the left, script on the right, both editable.

External editor tab

External editor tab with three options
External editor tab.

Three options: keep editing in the browser (Disable external editor), connect a local development server so you can work in your own IDE, or hand the code over to JSFiddle.

Exporting and duplicating a report

The three-dot menu with Save as, Print, Export to PDF and Export JSON
The … menu next to the report title.
  • Save as… — duplicate the report under a new name.

  • Print — the browser print dialog.

  • Export To PDF (as Image) — the rendered result as a PDF.

  • Export JSON — the report definition itself, for moving it to another instance.

For all export options, see How to export reports.

The built-in walkthrough

Scripted Report Introduction walkthrough dialog
The in-app introduction runs on first use and can be reopened at any time.

The first time you open the editor, a seven-step introduction walks you through the page; the Permissions tab has its own six-step version. Both can be reopened later from the help icon in the side navigation menu.

The editor tabs show an Act responsibly reminder. It is not decoration: the code you write runs in your users' browsers with their Jira session. Avoid insecure patterns, do not expose sensitive data in DOM elements, and read the policies before you ship a report to a wide audience.

Next: the working tutorial at Create your first Scripted Report

See also the report templates and the guides for individual reports.