Moogsoft Docs

addThreadEntry

A MoogDb v2 method that adds a new entry to an existing thread in a Situation. Threads are comments or 'story activity' on Situations.

Optionally, you can specify the new entry as being a resolving step.

This method returns the entry ID of the newly created thread entry.

Back to MoogDb V2 API Method Reference.

Request arguments

Method addThreadEntry takes the following request arguments:

Name

Type

Required

Description

entry

String

Yes

Description of the new entry you want to add to the existing thread. For example, "And another thing...".

Description of the new entry you want to create in the thread. For example, "And another thing...". HTML and XML tags are stripped from the thread entry text. Reserved characters are converted to HTML entities, for example, & is converted to &.

thread_name

String

Yes

Name of the existing thread.

user_id

Number

Yes

A valid user ID.

sitn_id

Number

Yes

Situation ID.

resolving_step

Boolean

No

Whether or not the thread entry you are adding is a resolving step. Default is false if not specified,

Response

Method addThreadEntry returns the following response:

Type

Description

Number

ID of the new thread entry.

API behavior in active and historic databases

The behavior of this method depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This method updates or returns information about the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of method addThreadEntry:

Request examples

Example request to add an entry "New Entry" to thread "Support" in Situation 158 using user ID 47. The resolving step parameter defaults to false.

var newThreadEntryID = moogdb.addThreadEntry(“New Entry”, “Support”, 47, 158);

Example request to add an entry "New Entry" to thread "Support" in Situation 58 using user ID 47. This thread entry is a resolving step:

var newThreadEntryID = moogdb.addThreadEntry(“New Entry”, “Support”, 47, 158, true)

Response example

Example response returning the new thread entry ID:

345