sendThreadEntries

This action sends all thread entries from the specified threads for the in-scope Situation to a named workflow in an inform-based workflow engine. This action does not calculate deltas; on each execution, it sends all thread entries regardless of whether they have been sent previously.

This action will generally be used just once per Situation to “bulk load” thread entries into a receiver e.g. to send all previous thread entries in a Situation at the point of a manual ticket creation. It does not need to be used where automated ticketing and thread entry synchronisation is in place.

Note

  • The thread entries will be paged to the receiving workflow in batches of 10: the action will retrieve 10 thread entries and dispatch them, fetch the next 10 and dispatch them, etc. If the receiving workflow is considered a “slow consumer” -- for example, if it’s doing an external REST request -- then a large number of input thread entries might result in a backlog at the receiving workflow.

  • This action will return true in all circumstances unless there is an error with the input parameters, for example an empty threads list. If the thread name does not exist or there are no thread entries, the action will still return true.

  • The action does not wait for the receiving workflow to complete before dispatching the next thread entry.

Each thread entry in the specified threads will be sent individually to the named workflow and will include the originating Situation as a triggering CEvent with the receiving workflow context containing:

  • threadText — the thread entry text

  • threadDetails — the full thread entry object

  • threadUser — the username of the user who entered the thread entry (based on the uid from the thread entry)

For example, the following shows the context sent to the receiving workflow from the sendThreadEntries action:

{
    "threadDetails": {
        "agrees": [],
        "total_comments": 0,
        "uid": 3,
        "entry": "Test thread entry",
        "thread_id": "Support",
        "resolving": false,
        "mmid": -1,
        "sig_id": 428,
        "entry_id": 6424,
        "timed_at": 1630446246,
        "disagrees": [],
        "commenters": []
    },
    "threadText": "Test thread entry",
    "threadUser": "Administrator"
}

Warning

The thread names shown in the UI are not all available to be sent via this tool. System specific threads — Alerts, Workflow, Tools, Impact, Modifications, Invitations — cannot be sent. Only “Posts” — the Support thread — or custom thread names can be sent.

This function is available as a feature of the Add-ons v2.3.5 download and later.

This function is available for Situation workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Name

Required

Type

Description

thread

yes

object

A list of thread names (case sensitive) to send.

engineName

yes

string

The name of the Inform based engine to send the thread entries to.

workflowName

yes

string

The name of the workflow to execute.

context

no

object

Additional context that should be sent in addition to the thread entry.

Example

Suppose you want to send all the “Posts” and “Notifications” thread entries to a workflow named “sendWorkNote” in the “Situation Inform Engine” with an additional context of the Situation description. The context parameter can use standard substitution for the in-scope Situation.

  • threads - [ “Posts” , “Notifications” ]

  • engineName - Situation Inform Engine

  • workflowName - “sendWorkNote”

  • context - { “descripton” : “$(description)” }

This would appear in the UI as:

{"threads":["Posts","Notifications"],"engineName":"Situation Inform Engine","workflowName":"sendWorkNote","context":{"description":"$(descripton)"}}