Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Current »

Abstract

This code snippet concatenates two text fields ignoring null values

Logic

Access the text fields and concatenate them

Snippet

textutils.noNull(<First text field>) + "<Delimiter>" + textutils.noNull(<Second text field>)

Placeholders

Placeholder

Description

Example

<First text field>
Accessing the first text field
issue.get("description")
"<Delimiter>"
Delimiter separating the text fields"\n"
<Second text field>
Accessing the second text field
issue.get("summary")

Examples

The output of this code is a String which you could, for example use in:

A Groovy expression, for example to:

  • Set a text field to the concatenation of two other text fields. Eg: The summary of the issue to the concatenation of two custom field values, say Customer Name and Machine details in:
    • one of the Set Field Value post-functions
    • the Create issue post-function under Set fields of new issue section

      textutils.noNull(issue.get("Customer Name")) + textutils.noNull(issue.get("Machine details"))

A Groovy template, for example to:

  • Include the key and description while notifying the customer when their issue has been resolved:
    • Comment in one of the Comment issue post-functions
    • Subject/HTML body/Text body of Email issue post-function

      Your issue <%=textutils.noNull(issue.getKey())%> - <%=textutils.noNull(issue.get("description")) %> has been resolved.

References

Filter by label

There are no items with the selected labels at this time.

  • No labels