Availability
This routine is available starting with katl-commons 2.5.7.
Syntax
arrayIntersect(arrayName1, arrayName2)
Description
Intersect between two arrays.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
arrayName1 | array | Yes | The first array. |
arrayName2 | array | Yes | The second array. |
Return Type
array
Example
string[] developers= usersInGroups({"jira-developers"}); string[] administrators = usersInGroups({"jira-administrators"}); return arrayIntersect(developers, administrators);
The result returned by the routine is an array which contains the unique elements found in both developers and administrators groups.
The above code can be written also as shown below:
return usersInGroups({"jira-developers", "jira-administrators"});
That's it.
See also