Skip to main content

Listing Column Configuration

Listing Column

tSM automatically includes standard fields in every Listing record, such as GUIDs, ID keys, and other identifiers. These fields are stored in their raw format, which can be hard to read in reports. To make the data more user-friendly, you can transform these raw values into clearer, more meaningful ones. For example, you can:

  • Replace raw IDs with logical names.
  • Calculate new values based on existing data.
  • Customize columns for improved data presentation.

The Column Configuration feature makes these changes possible by allowing you to create custom fields directly in the Table Column Configuration window.

Navigation:
Main Menu → Settings → Listening → Table Column Configuration

Column Configuration Features

Custom Field Setup
When creating a custom field, users must define:

  • Listing Type: Where the field appears.
  • Field Name & Title: Unique identifiers.
  • Data Type: Number, text, date, or picklist.
  • Visibility Settings: Define user access.
  • Field Linking: Associate the custom field with a data source field.

Additional Settings:

  • Tooltip: Displays extra information in widgets.
  • Position: Determines tooltip placement.
  • Read Privilege: Controls user access.

Table Column Configuration UI:

Design Area – Visual Customization

  • Displayed Field: Choose a field whose values should be shown instead of the raw values.
  • Weight (px): Define the width of the display component (box or cell).
  • CSS Class: Apply custom styles for HTML display.
  • Converter: Select a function to transform field values into a more user-friendly format.

Converter Functions:
Each converter function requires parameters that must be configured in the Parameter Box.

Filter Area – Data Filtering
Users can define filters for all displayed rows in Listener.

Filtering Options: Filter UI Example

  • Field: Select the field to filter, sort, and display.
  • Full Text Search: Enable searching within field values.
  • Widget Type: Choose a filter widget (e.g., a calendar range selector).
  • Context Parameters: Provide additional filter parameters (in array format).
  • TQL Usage: Replace deprecated additional filter parameters.
  • Default Values: For example, tasks.active for a ticket list.

Ordering Area – Sorting Field Values
Users can define custom sorting rules for a field. These rules allow you to use other fields for ordering.

Scripting in Column Configuration

Using a script to define an Elasticsearch script enhances the ability to link data fields in the Elasticsearch index to Listener records. For scripting, use the Painless editor. Note that the tSM column editor does not support multiline formatting for Painless scripts. Instead, the script must be provided as a single string.

Sample Code:

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
try {
// Extract start times for "testName" activity
def startTime = params._source['tasks']?.stream()
?.filter(item -> (item?.activityId != null
&& item?.activityId.contains("testActivity")
&& item?.name.contains("testName")))
?.map(l -> l.startTime)
?.collect(Collectors.toList());

// Extract start times for "testId" activity
def endTime = params._source['tasks']?.stream()
?.filter(item -> (item?.activityId != null
&& item?.activityId.contains("testId")
&& item?.startTime != null))
?.map(l -> l.startTime)
?.collect(Collectors.toList());

// Check if both lists are populated
if (startTime != null && !startTime.isEmpty() && endTime != null && !endTime.isEmpty()) {
// Convert start times to epoch milliseconds and find the minimum values
long minStartTimeMillis = startTime.stream()
.mapToLong(dateTime -> ZonedDateTime.parse(dateTime, formatter).toInstant().toEpochMilli())
.min()
.orElseThrow(() -> new IllegalStateException("No valid start time found"));

long minEndTimeMillis = endTime.stream()
.mapToLong(dateTime -> ZonedDateTime.parse(dateTime, formatter).toInstant().toEpochMilli())
.min()
.orElseThrow(() -> new IllegalStateException("No valid end time found"));

// Return time difference in seconds
return (minEndTimeMillis - minStartTimeMillis) / 1000;
} else {
return null;
}
} catch (Exception e) {
return -1;
}

Key Adjustments for Saving the Script:

  • Single-Line Format: Elasticsearch requires the script as a single line in JSON. Replace newlines with spaces.
  • Escaped Double Quotes: Ensure double quotes are escaped for JSON formatting.
  • Preserved Functionality: The script’s logic remains unchanged.

Usage in Column Configuration: