# appendEmailBtn(row, column)

Appends a copy email button that runs copyEmailToClipboard when clicked.

Parameters

Name Types Description
row HTMLElement - The HTML row element found in ServiceNow
column number - The column number where descriptions are located. Defaults to 3.

# appendNameBtn(row, column)

Appends a copy name button that copies the first and last name in order without the comma

Parameters

Name Types Description
row HTMLElement - The HTML row element found in ServiceNow
column number - The column number where "Opened By" names are located. Defaults to 11.

# appendTaskBtn(row, column)

Appends a copy task button that copies task number

Parameters

Name Types Description
row HTMLElement - The HTML row element found in ServiceNow
column number - The column number where task numbers are located. Defaults to 2.

# copyEmailToClipboard(devName, userName)

Copies an email message to the clipboard containing details like device name and the user's first name.

Parameters

Name Types Description
devName string - device name that is returned by getDeviceName()
userName string - user name that is returned by getUserName()

# document.addEventListener()

Calls the main function upon the keypress of the backquote (`) character

# getDescription(row)

Returns the description from a row

Parameters

Name Types Description
row HTMLElement - HTML row element

Returns

string

string containing descriptions

# getDescriptions(rows)

Returns descriptions from a nodelist of rows

Parameters

Name Types Description
rows nodelist - Nodelist of rows where the 3rd element is the description

Returns

(string|Array)

Array of strings containing descriptions

# getDevName(description)

Gets the device name from a description.

Parameters

Name Types Description
description string

Returns

string

Line containing device name, or null if not found

# getFromRegex(string, regex)

Gets a result from a regex. Returns null if no match found

Parameters

Name Types Description
string string - The string that the regex will perform a match on
regex string - Pattern that you want to test for

Returns

string

Line containing regex, or null if not found

# getUserName(description)

Gets the "requested user" name from a description.

Parameters

Name Types Description
description string

Returns

string

Line containing user name, or null if not found

# main()

The main function. Colorizes rows, shortens descriptions, and adds buttons.

# setColor(row)

Sets the color of the row based on the 12th child. When the 12th child contains my name "Cardosi, Alexander", the color will be marked green. Marks special cases yellow

Parameters

Name Types Description
row HTMLElement - The HTML row element

# setDescriptions(descriptions, rows)

Sets each description in the array to their respective columns. The array has to be the same length as the number of rows

Parameters

Name Types Description
descriptions (string Array)
rows HTMLElement - HTML element of the rows

# specialCases()

Special cases. Will be highlighted in yellow.