Class: JQL

JQL

new JQL()

Constructor
Source:

Methods

getValueFromPath(val, concreteExpr, defaultValue) → {*}

If the given object or array (val) has a value at the given location (concreteExpr), that value is returned; otherwise the defaultValue is returned.
Parameters:
Name Type Description
val JSON JSON object or array
concreteExpr String JQL expression without wildcards, conditions, or parent references
defaultValue * Value to return if nothing is found in object at desired location
Since:
  • 0.9
Source:
Returns:
Type
*

insert(val, expr, newValue) → {*}

Inserts a value (newValue) into a given object or array (val) at the location(s) specified by the JQL expression (expr)
Parameters:
Name Type Description
val JSON JSON object or array
expr String JQL expression which can include wildcards, parent references, etc.
newValue * Value to insert
Source:
Returns:
Type
*

insertValue(val, concreteExpr, newValue) → {*}

Inserts a value (newValue) into a given object or array (val) at the location specified by the concrete JQL expression (concreteExpr)
Parameters:
Name Type Description
val JSON JSON object or array
concreteExpr String JQL expression without wildcards, conditions, or parent references
newValue * Value to insert
Source:
Returns:
Type
*

pathExists(val, concreteExpr) → {boolean}

Checks whether the given object or array (val) has a value at the given location (concreteExpr)
Parameters:
Name Type Description
val JSON JSON object or array
concreteExpr String JQL expression without wildcards, conditions, or parent references
Since:
  • 0.9
Source:
Returns:
Type
boolean

remove(val, expr) → {*}

Removes values at all locations matching the JQL expr in the given object or array (val). DANGEROUS! :-)
Parameters:
Name Type Description
val JSON JSON object or array
expr String JQL expression which can include wildcards, parent references, etc.
Source:
Returns:
Type
*

removeValue(val, concreteExpr) → {*}

Removes values at the location specified by the JQL concreteExpr in the given object or array (val)
Parameters:
Name Type Description
val JSON JSON object or array
concreteExpr String JQL expression without wildcards, conditions, or parent references
Source:
Returns:
Type
*
Deprecated - use searchAndGetValues instead!
Parameters:
Name Type Description
val JSON JSON object or array
expr String JQL expression which can include wildcards, parent references, etc.
Deprecated:
  • Use searchAndGetValues instead!
    Source:
    Returns:
    Type
    Array

    searchAndGetPaths(val, expr) → {Array}

    Returns the locations (concrete paths) to all values in the given object or array (val) which match the given JQL expression (expr)
    Parameters:
    Name Type Description
    val JSON JSON object or array
    expr String JQL expression which can include wildcards, parent references, etc.
    Source:
    Returns:
    Type
    Array

    searchAndGetValues(val, expr) → {Array}

    Returns the values found in the given object or array (val) at all locations matching the given JQL expression (expr)
    Parameters:
    Name Type Description
    val JSON JSON object or array
    expr String JQL expression which can include wildcards, parent references, etc.
    Source:
    Returns:
    Type
    Array

    setValue(val, concreteExpr, newValue) → {*}

    Deprecated - use updateValue instead!
    Parameters:
    Name Type Description
    val JSON JSON object or array
    concreteExpr String JQL expression without wildcards, conditions, or parent references
    newValue * New value
    Deprecated:
    • Use updateValue instead!
      Source:
      Returns:
      Type
      *

      update(val, expr, newValue) → {*}

      Assigns a new value (newValue) to all location(s) matching the JQL expr in the given object (val)
      Parameters:
      Name Type Description
      val JSON JSON object or array
      expr String JQL expression which can include wildcards, parent references, etc.
      newValue * New value
      Source:
      Returns:
      Type
      *

      updateValue(val, concreteExpr, newValue) → {*}

      Assigns a new value (newValue) at the location matching the JQL concreteExpr in the given object (val)
      Parameters:
      Name Type Description
      val JSON JSON object or array
      concreteExpr String JQL expression without wildcards, conditions, or parent references
      newValue * New value
      Source:
      Returns:
      Type
      *