Sometimes you might just want to display some extra information about the issue, and not be able to search it. If you like, your script can output HTML, and you effectively don’t use a velocity template. This is similar to the now obsolete "velocity-processed custom field for view", but on steroids.

In this case use the HTML template option. There’s no point in enabling a searcher as there is not one that can handle HTML.

As an example, let’s say we want to draw attention to an issue when it is blocked by other issues that are not resolved, and not assigned. (Or not scheduled, not reviewed, whatever).

The field on the screen will look like this:

blockedIssuesWarning

In the code below I use a MarkupBuilder, although feel free to just construct a string containing html and return that. As usual return null if there are no blocking issues, so the field is not displayed at all.

Unresolved directive in <stdin> - include::../jira/src/test/resources/com/onresolve/jira/groovy/test/scriptfields/scripts/showLinkedIssuesInfoMsg.groovy[]

Template

HTML

Searcher

None

For how-to questions please ask on Atlassian Answers where there is a very active community. Adaptavist staff are also likely to respond there.

Ask a question about ScriptRunner for JIRA, for for Bitbucket Server, or for Confluence.