Hello,
I am writing a groovy code. My Code has two List of type Option value fetched from custom field(NewRes and OldRes).
def ListA = issue.getCustomFieldValue(newRes) as List<Option>
def ListB= issue.getCustomFieldValue(oldRes) as List<Option>
Assume that Option List A and List B has following set of values:
List A : { os, op, jp, zp} and
List B : {op,zp}
How to find elements such that they are in List A but not in List B.
I need a third List option(List C) with elements in A but Not in B i.e List C must contains { os, jp}
Please reply. Thanks !
You can try use:
def newlist = ListA.minus(ListB);
For your reference see the API http://docs.groovy-lang.org/latest/html/groovy-jdk/java/util/List.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
def ListC = ListA - ListB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.