getOptions

    Signature

    HelpernodeHelper
    Signature
    • getOptions(Issue issue,String customFieldName, List of Strings names)
    • getOptions(Issue issue,Long customFieldId, List of Strings names)
    Description

    Allows retrieving a list of options from a custom field.

    Introduced in0.8

    Example use

    Set options Happy, Sad, Lucky to the custom field Mood.

    def moodOptions = nodeHelper.getOptions(issue, "Mood", ["Happy", "Sad", "Lucky"]) 
    issue.customFields."Mood".value = moodOptions

    Using the Custom Field Id instead of the Custom Field Name

    Set received options to the local custom field with ID 10201

    // When using field's id, add L at the end of the Id. E.g. 10201L is custom field id with L added at the end.
    issue.customFields."10201".value = nodeHelper.getOptions(issue, 10201L, replica.customFields."Remote select List CF Id".value.collect {it -> it.value})

    Comments

    • The options are only available for custom fields with distinct values such as a select, radio button, or checkbox custom field