Versions Compared

Key

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

...

You can use text variables in most places in Refined where you can add text: layouts, categories, modules, announcement banners, and more. Refined features default text variables, as well as the option to create your own custom text variables (available in Refined for Jira Service Management version 3.2 and up).

...

Table of Contents

...

These out-of-the-box text variables are available by default.

Variable

Description

Introduced in version

$username

The logged-in user’s username.

 

$userfullname

The logged-in user’s full name.

 

$userfirstname

The logged-in user’s first name.
Note: this does not work for names formatted as "lastname, firstname."

2.0

$sitename

The site’s name.

2.0

$siteid

The site’s ID.

2.0

$categoryname

The category’s name.

2.0

$categoryid

The category’s ID.

2.0

$serviceprojectdesc

The service project’s description.

3.5

$serviceprojectid

The service project’s ID.

Note: this text variable used to be called $servicedeskid.

2.0

$serviceprojectname

The service project’s name.

Note: this text variable used to be called $serviceprojectname.

2.0

Custom text variables

A custom text is one that you set up in your system. This lets you create even more dynamic content on your website and lets to create a dictionary for the language switcher.

...

It’s possible to nest one or more default variables within a custom text variable, for example:

Custom text variable

Value

$welcome$

Welcome to $sitename, $userfirstname!

However, it is not possible to nest custom variables within one another. This means that the following would not work:

Custom text variable

Value

$first$

coffee

$second$

I like $first$

Note that in the Site Builder you can only use custom text variables that don’t nest any variables at all, or that nest one or more of the following variables:

Text variable

Description

Introduced in version

$username

The logged-in user’s username.

 

$userfullname

The logged-in user’s full name.

 

$userfirstname

The logged-in user’s first name.
Note: this does not work for names formatted as "lastname, firstname."

2.0

Examples of custom variables

...

Wrap your script in curly brackets: {script}. Everything within the brackets will be replaced by the script’s returned value. The script will be executed using a Function() constructor.

Examples

Custom text variable

Value

$copyrightMessage$

Copyright ACME {return (new Date()).getFullYear()}"

$greeting$

{if ((new Date).getHours() < 12) { return "Good morning" } else { return "Good afternoon" }}

Limitation

The logic syntax works in every area of Refined where you can use default text variables, except in the Site Builder.

...