Custom Variables
Response Templates support various built-in variables, which act as placeholders.
When the template is inserted, the variable is evaluated, and the corresponding value is inserted where the variable is.
While built-in variables largely correspond to issue fields, project references, or a few generic values like date, time, and so forth, they do not allow for any user-defined values.
This is where custom variables come in. You can create an arbitrary set of variables, with any text value of your choice, and then reference them in templates.
Whenever the template is inserted, the current value of that variable is used.
Note: If you change the value of a custom variable, then all future instance will receive the new value, while the already inserted templates will retain the old value of course.
Custom variables can be managed from the app configuration screen. You can get there using the gear icon in the Jira header to navigate to the "Manage Apps" screen, and then finding the "Configuration" item under the "Simple Responses" heading in the left sidebar.
Click on the Variables
link, and you shoud see a screen like this:
This is where you would see any existing variables. To create a new one, click on the "Create Variable" button, which brings up a dialog to create the new variable:
Give the variable a name, and a value.
THe name is how you would reference the variable in a template, and must be unique across all variables, including the built-in ones. If you accidentally try to create a variable with a conflicting name, the dialog will let you know through an error message.
The value is the value our app inserts into a template when the template is being used.
Once you're done, click on the Create button, and the new variable is created, and should show up in the list.
From there, you could use it in a template, by referencing it via the standard syntax we use: $variableName$
.
Based on the screenshort for example, if we wanted to mention fish
:
Current LimitationsFor now, custom variables only support string values with a maximum length of 255 characters.
If this is too limiting, let us know, as we would love to hear your specific use case to improve this functionality.