Our new Appfire Documentation Space is now live!

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

Post-Function Concatenation Operations

Supported concatenation operations

It is possible to concatenate, or string together, one or more source values to an existing field value/s. JSU post functions that support the concatenation of field values include:

  1. Create Linked Issue (JSU) (all sub-functions) - separator string configurable

  2. Copy Value From Other Field (JSU) - separator string non-configurable as “,” (comma)

  3. Linked Transition (JSU) - separator string non-configurable as “,” (comma)

  4. Update Any Issue Field (JSU) - separator string non-configurable as “,” (comma)

Common applications

Q) Previously in the “Create Linked Issue (JSU)” post-function, it was possible to append a value to an empty target field by selecting “*** empty ***” as the source field and defining “Text to Insert” as the separator. Now, when the target field value is empty, this no longer works.

A) The “Set” as a “Create Linked Issue (JSU)” sub-function was introduced after “Copy to New”, so some users were accustomed to setting an empty target value in this way. While this workaround did work, it would result in the target field value being concatenated with the defined separator whenever the post function was executed. As a result, the target field value would perpetually get longer.

If the intention is to set an “initial” target field value, then we recommend the following approach:

  • Set Value to Field on New: Summary to [PREFIX]

  • Copy to New: Summary to Summary, append with separator: with  -

Using this approach, the target field value will not be perpetually concatenated.

Concatenation modes

The above-mentioned post functions support the overwrite, append, and, with the exception of the "Update Any Issue Field (JSU)" post function, the prepend concatenation modes. In addition, the "Create Linked Issue (JSU)" post function supports the definition of a separator string when concatenating multiple values to a target text field.

The behavior of a field concatenation operation depends on the source and target field types. Concatenation field types are generally categorized into two main types:

  1. Collection Fields (i.e. “Affected Version/s”, “Fixed Version/s”, “Component/s”, “Custom Field Cascading Select”, “Custom Field Multi-Select”, “Custom Field Multi-Checkboxes”, “Custom Field Select”, “Custom Field Radio”)

  2. Single Value Fields (i.e. “Assignee”, “Reporter”, “Summary”, “Description”, “Due Date”, “Custom Field Text”, “Custom Field Multi-line Text”, “Custom Field Number”, “Custom Field Date”, “Custom Field Date/Time”)

A Collection Field is empty if it contains no selection. In this case, a Collection Field will be interpreted as having the value null, when evaluated as a source field or when saved as a target field.

A Single Field value either has a value or is set to null. In the case of text field types, the empty/blank string is saved in Jira as the value null. A text field will never be saved with a blank string value.

The pseudo Source Field selector “*** empty ***”

As stated previously, Jira will never save a text Single field value as a blank string. In the “Copy Value From Other Field (JSU)”, “Linked Transition (JSU)”, “Create Linked Issue (JSU)” sub-functions “Copy to New” and “Copy with Origin” configurations, the “*** empty ***” source pseudo-field may be selected, is equivalent to passing an empty string as the source value. This configuration only has relevance when the target field is a text Single field value and is the only possibility to append/prepend a blank string to an existing field value.

Additionally when the “Update Any Issue Field (JSU)” or “Create Linked Issue (JSU)” sub-function “Set” is configured with the concatenation mode append/prepend and the field value is set as blank, it will be interpreted as the same as the “*** empty ***” string source value. When these configurations are defined as having the field value set as blank and the concatenation mode set as “overwrite”, the source value is interpreted as having the value null.

Collection Field concatenation

When a Collection Field is selected as the source of a concatenation operation, the target field type determines how it will be concatenated:

  1. If the source value is a Collection Field and the target field type is a multi-value Collection Field, then JSU will attempt to concatenate/overwrite the target field values with the source field values if they do not already exist in the target field values. If the resulting concatenated target Collection Field is empty, it will be saved with the null value. In this constellation, or grouping, the configured separator has no relevance, but the concatenation mode will determine whether the original target field values are preserved or not.

  2. If the source field is a Collection Field and the target field type is a single-value Collection Field or a non-text type Single Field then the target field value will be overwritten with the first value of the source Collection Field, or null if the source Collection Field is empty. In this constellation, the configured separator and the concatenation modes have no relevance, since the target field can only contain a single value or null.

  3. If the source field is a Collection Field and the target field is a text type Single Field, then the source field values are converted to a collection of text values (i.e. Component Name, Version Name, Select Label, etc..) and concatenated to a string with the configured separator, before concatenating/overwriting the target text type Single Field with the configured separator. If the source Collection Field is empty, it will be interpreted as having the value null and will not be appended/prepended to any existing target field value. In this constellation, the configured separator and the concatenation modes have significance in the concatenation of source Collection Field values as well as the position of the concatenated values in the resulting target text field value.

Single Value Field concatenation

When a Single Value Field is selected as the source of a concatenation operation, the target field type determines how it will be concatenated:

  1. If the source field is a Single Field and the target is a non-text Single Field, then JSU will attempt to apply/convert the source field value when setting the target field value. In this constellation the configured separator and the concatenation modes have no relevance, since the target field can only contain a single value or null.

  2. If the source field is a Single Field and the target is a text Single Field, the then JSU will attempt to apply/convert the source field value as a string, before overwriting/concatenating the target text field value with the configured separator string. If the converted source value is null, then it will not be appended/prepended to any existing target field value. In this constellation the configured separator and the concatenation modes have significance in the concatenation of source and target values as well as the position of the concatenated values in the resulting target text field value.

  3. If the source field is a text Single Field and the target is a Collection Field, the source field will be split as a collection on the “,” (comma) delimiter, before attempting to apply/convert the source value/s to the target field value/s. The “delimiter” string is currently non-configurable in any of the JSU post-function configuration options.

Text Single Field target concatenation table

Notes:

  1. Where the separator is non-configurable, the value “,” (comma) is implicitly used.

  2. Equivalent to "Set Field Value (Clear) (JSU)", “Clear Field Value (JSU)”

Source Value

Target Value

Concatenation Mode

Separator

Result

Notes

Source Value

Target Value

Concatenation Mode

Separator

Result

Notes

null

null

overwrite

"@@"

null

 

null

null

append

"@@"

null

 

null

null

prepend

"@@"

null

 

null

“TA”

overwrite

"@@"

null

 

null

“TA”

append

"@@"

“TA”

 

null

“TA”

prepend

"@@"

“TA”

 

[]

null

overwrite

"@@"

null

 

[]

null

append

"@@"

null

 

[]

null

prepend

"@@"

null

 

[]

“TA”

overwrite

"@@"

null

 

[]

“TA”

append

"@@"

“TA”

 

[]

“TA”

prepend

"@@"

“TA”

 

"SA"

null

overwrite

"@@"

“SA”

 

“SA”

null

append

"@@"

“SA”

 

“SA”

null

prepend

“@@”

“SA”

 

"SA"

“TA”

overwrite

"@@"

“SA”

 

"SA"

“TA”

append

"@@"

“TA@@SA”

see note: 1

"SA"

“TA”

prepend

"@@"

“SA@@TA”

see note: 1

[“SA”]

null

overwrite

“@@”

“SA”

 

[“SA”]

null

append

“@@”

“SA”

 

[“SA”]

null

prepend

“@@”

“SA”

 

[“SA”]

“TA”

overwrite

“@@”

“SA”

 

[“SA”]

“TA”

append

“@@”

“TA@@SA”

see note: 1

[“SA”]

“TA”

prepend

“@@”

“SA@@TA”

see note: 1

[“SA”, “SB”]

null

overwrite

“@@”

“SA@@SB”

see note: 1

[“SA”, “SB”]

null

append

“@@”

“SA@@SB”

see note: 1

[“SA”, “SB”]

null

prepend

“@@”

“SA@@SB”

see note: 1

[“SA”, “SB”]

“TA”

overwrite

“@@”

“SA@@SB”

see note: 1

[“SA”, “SB”]

“TA”

append

“@@”

“TA@@SA@@SB”

see note: 1

[“SA”, “SB”]

“TA”

prepend

“@@”

“SA@@SB@@TA”

see note: 1

Empty Pseudo Value

null

overwrite

“@@”

null

see note: 2

Empty Pseudo Value

null

append

“@@”

“@@”

see note: 1

Empty Pseudo Value

null

prepend

“@@”

“@@”

see note: 1

Empty Pseudo Value

“TA”

overwrite

“@@”

null

see note: 2

Empty Pseudo Value

“TA”

append

“@@”

“TA@@”

see note: 1

Empty Pseudo Value

“TA”

prepend

“@@”

“@@TA”

see note: 1