User guide
JS contexts
The Custom JS unlocks the possibility to add custom scripts to your JIRA instance. Where these scripts will be run, is triggered by the context you add them to. A context may be understood as a page or a set of pages in JIRA. Five different contexts are available, represented by tabs in the add-on UI:
Context | Description |
---|---|
General | The general context includes all JIRA screens, except for the Administration section. So scripts you add to this section will be triggered on every JIRA screen, except for the Applications, Projects, Issues, Add-ons and User Management screens and there sub-screens in the Administration section. |
Dashboard | The Dashboard context includes all Dashboards that have been configured in your JIRA instance. This includes private and shared dashboards as well as the System Dashboard. |
User Profile | The User Profile context refers to the User Profile pages of your JIRA Users. Scripts you add to this context will apply to these profile pages only. |
JIRA Issue View | The JIRA Issue View context refers to the view issue issue page in JIRA. |
Tempo Worklog | The Tempo Worklog context covers all Tempo Timesheets screens allowing you to log work. |
To apply a script to a specific JIRA context, just select the tab for that context and add your script on that tab.
Adding a script
To add a script to a specific context, follow the steps below:
- Navigate to the Custom JS Configuration page.
- Select the tab for the context you want to add your script to. In the example below, we use the Tempo Worklog context.
- Click Edit.
- Add your script in the editor window. Syntax highlighting makes your script easy to read.
- When you're done, click the Save button.
Your script will look like this:
The example code changes the displayed text and font color of the username as displayed on Tempo Timesheets screens. When you open this screen, the script is run and you can see the result, like shown on the screenshot below:
Examples
Custom JS for JIRA is a powerful extension to your JIRA instance. The power is in the flexibility offered through scripting. Possibilities are endless, so check our Examples page to get inspired.