Similar to the question about Groovy Script compare version picker, I want a scripted field to compare two custom version picker fields within an issue. One field is a multi-select version picker (exists in) and the other is a single-select version picker (found in). Both are required and will always have a value.
If any of the version IDs listed in “ExistsIn” are less than the single version ID set for “FoundIn”, the result should be true.
I couldn’t figure out how to calculate "ExistsIn" < “FoundIn”, so I tried this, which kind of works:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField FoundIn = customFieldManager.getCustomFieldObject("customfield_11800");
CustomField ExistsIn = customFieldManager.getCustomFieldObject("customfield_10007");
if (ExistsIn != FoundIn) return "Yes"
else
return null
The issues are still reindexing, but it looks l like they’re all being set to Yes, even when the value in both fields is identical. 
As an added challenge, I want to exclude issues that have a certain version ID set for “ExistsIn”. (ExistsIn != “17407”)
Any help would be appreciated!