Auto-Links

Auto-Links can be used to configure expressions to find texts in tickets that should automatically updated with a link. This can be useful if other tickets or external pages for should be referenced quickly within ticket texts in the Tickets application.

Expression

The expression is a regular expression to find the desired texts. As a special rule, the expression must contain at least one group (a pair of parentheses). This group (it must be the first group of the expression) marks the ID, which is a number or string which can then be linked to in the resulting link (e.g. a ticket-ID).

In the example "#([0-9]+([.,][0-9]{3})*)" the digits, as well as if necessary thousand separators, are enclosed by the brackets, but the hash-sign is not. In the link, these digits are then used as {id_int} in the URL.

See https://www.regular-expressions.info/quickstart.html for more information on how regular expressions work.

The Link in the configuration represents the URL. The following placeholders can be used:

  • {id}: this is the ID marked in the expression, without any conversions. It can contain any character.
  • {id_int}: this is the ID marked in the expression, converted to an integer. Possible thousands separators are removed. Remember that ',' or '.' are always interpreted as thousands separators, not as decimal points. If no conversion is possible this placeholder will not be replaced.
  • {serverurl}: the base server URL of this server. Never ends with a slash. Does not need to be used when linking to external pages.

Examples

Predefined linking:

  • Expression #([0-9]+([.,][0-9]{3})*)
    • This finds texts where a hash is followed by one or more digits. The digits may contain thousands separators '.' or ','.
  • Link {serverurl}/ticketlist/ticket/{id_int}
    • The found expression is displayed as a link, linking to a ticket with the respective ID ({id}).

Additional example:

  • Expression inv-([a-zA-Z0-9]+)
    • This finds texts where "inv-" is followed by a string consisting of letters and numbers.
  • Link https://department.company.com/inventory/{id}/view
    • In the link, the string is used to call a page for the corresponding device.

Further Notes

  • The expression is automatically expanded to avoid matches within HTML tags, HTML entities or within existing links.
  • It is strongly discouraged to use so-called wildcard expressions, such as ".*" or ".+". These expressions match arbitrary characters, as well as HTML control characters ("<,>,") and there is a risk of then suddenly matching the entire text.
  • The text of the rendered link is always the original text matched by the expression. (e.g. "#12.234")
  • If you need to match HTML characters ", <, >, & or other unicode characters, you must use the unicode notation in your expression. I.e. to find an & followed by ä, your expression might look like &amp;&#228;(\d*).