Routine Index
A complete list of routines that is useful for searching.
Array Routines
This section contains routines that enable users to handle arrays.
- arrayAddElement — If elem is an element of the array type, returns a new array that includes the specified element at the end.
- arrayAddElementIfNotExist — If elem is an element of the array type, returns a new array that includes the specified element at the end. The element is added only if it is not already in the array.
- arrayDeleteElement — If elem is an element of the array type, returns a new array without the specified element.
- arrayDeleteElementAt — If index is less than the array size, returns a new array without the element at the specified index.
- arrayDiff — Difference between two arrays. Returns the elements from the first array that do not exist in the second array.
- arrayElementExists — Returns "true" if the element exists in the array and "false" otherwise.
- arrayFind — Finds an element inside the collection and returns its index. If the element is not found, it returns -1.
- arrayFindBinary — Binary search on sorted array. If the element is not found, returns -1.
- arrayGetElement — Returns the element at the specified index.
- arrayIntersect — Intersect between two arrays.
- arrayKeys — Returns the keys of the array.
- arrayKeySort — Sorts the elements from an array by their keys. Works with keyed arrays only.
- arraysConcat — Adds the elements of the second array to the first one.
- arraySetElement — If elem is an element of the array type, returns a new array with the specified element on position index1.
- arraySize — Returns the size of the given array.
- arraySort — Sorts the elements from an array.
- arrayStructMap — Returns an indexed array of structs mapped to a given field name.
- arrayStructSort — Sorts the elements from an array by their specified field. Works only with arrays that contain structures.
- arrayToSet — Converts an array to a set of unique elements.
- arrayUnion — Union between two arrays.
- excludeSubarray — Returns an array excluding the array that starts at index 'start' and ends at index 'end'.
- subarray — Returns an array starting with index 'start' and ending at index 'end'.
Basic Routines
This section contains routines that provide basic language behavior.
- logPrint — Prints a message in the configured Jira logs on the specified level: TRACE, DEBUG, INFO, WARN, ERROR, FATAL.
- isNull — Checks if the provided variable is null or has no value associated then returns "true", otherwise returns "false".
- isNotNull — Checks if the provided variable is not null or has a value associated and returns true. Otherwise returns false.
- print — Returns the printable string in the application log.
- runnerLog — Puts the 'message' on the console of a runner gadget.
- lastExceptionClass — Returns the class of a Java class exception when an error is thrown.
- lastExceptionMessage — Returns the message of a Java class exception when an error is thrown.
Date and Interval Routines
This section contains routines that enable users to deal with dates.
- addMonths — Adds a number of months to a specified date, preserving the day of month where possible.
- currentDate — Returns the current date.
- day — Returns a number representing the day of month: 1-31.
- dayOfWeek — Returns the day of week.
- endOfMonth — Returns a date set on the last day of the month for the given date.
- formatDate — Formats the given date into a date/time string accordingly to the given format expression.
- hour — Returns the hour of the provided date: 0-23.
- millisToDate — Converts milliseconds to a date.
- millisToInterval — Converts milliseconds to a time interval.
- minute — Returns the minutes of the provided date: 0-59.
- month — Returns a number representing the month of the provided date (1-12).
- monthName — Returns the month name of the provided date.
- parseDate — Returns the parsed date according to the format you provided. If parse fails, it will return a null date.
- second — Returns the seconds of the provided date: 0-59.
- startOfDay — Returns a date, but strips off the hours, minutes and seconds.
- startOfMonth — Returns a date set on the first day of the month for the given date. Also sets hours/minutes/seconds to 0.
- toDate — Creates a date value from the specified parameters.
- toJiraDateFormat — Displays the given date using Jira format.
- toRawWorkingInterval — Returns a date interval converted to the specified number of hours per day.
- toTimeZone — Converts a date to the specified time zone.
- week — Returns the week number in the year of the provided date.
- year — Returns the year of the provided date.
File Manipulation Routines
This section contains routines that enable users to handle directories and files.
- readFromCSVFile — Reads the values from the CSV file, returning them to an array, of N rows * M columns values.
- createDirectory — Returns "true" if the directory was created successfully and "false" otherwise.
- createFile — Creates an empty file.
- deleteFile — Deletes a file. It also returns "true" if the file was deleted successfully and "false" otherwise.
- directoryExists — Returns "true" if the directory exists and "false" otherwise.
- fileClose — Closes a previously opened file and removes it from memory.
- fileContains — Returns "true" if the file contains any string that matches the specified regex.
- fileCopy — Copy a file from one location to another.
- fileExists — Returns 'true' if the file exists and 'false' otherwise.
- fileInfo — Returns basic file information about a file such as the date it was created.
- fileMove — Moves a file from one location to another.
- fileOpen — Opens a file in memory so that it may be read from.
- fileRead — Reads a byte array from a file until it reaches the specified length or until the EOF is reached.
- fileReadByte — Reads a byte from an open file.
- fileReadLine — Reads a line of text from an open file until it reaches the end of the line (\n or \r\n). Stops also on EOF (end of file).
- fileSeek — Moves the file pointer to a specific spot in an already open file. If the position is negative, moves the file pointer at the end of the file. If the position is 0 (zero) it moves the pointer at the beginning of the file.
- fileSHA256Checksum — Returns the SHA256 checksum of the file.
- fileSize — Returns the size for a given file.
- fileTruncate — Clears the content of the specified file. Creates a new file if the one you want to clear content for doesn’t exist.
- fileWrite — Writes text or byte data to an open file.
- findDirectories — Searches for directories that match the given regex in the specified folder.
- findFiles — Searches for files that match the given regex in the specified folder.
- printInFile — Prints the provided value in the specified file.
- readFromBinaryFile — Read the text of a binary file.
- readFromTextFile — Read the text of the file.
- renameFile — Renames a file.
- writeToBinaryFile — Prints bytes to a specified file. The file can be overwritten or appended to.
- zipFiles — Adds a file or an array of files to a zip file.