Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Warning

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !

Info
titleAvailability

This routine is available starting with katl-commons SIL Engine™ 1.0.

 


Syntax

arrayAddElementIfNotExist(arrayName, elem)

...

addElementIfNotExist(arrayName, elem)

Parameters

Parameter name

Type

Required

Description

arrayName

array

Yes

The array to which

Array the new element is added to.

elem

any

Yes

The element

Element to be added. Must be the same type as the array type.

Return Type

array

Example

example 1

...

Adds currentUser to the watchers array if currentUser is not already present. The routine returns a new array watchers2, so the initial array will not be modified.

example 2

Code Block
watchers = addElementIfNotExist(watchers, currentUser());

The initial array will be modified as a result of the = operator and NOT of the routine call.

...