Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

Set default user picker (multi)

 
1
0
-1
Hi there, I would like to set a default value (2 or more) for a user picker (multi). Any help will be appreciated. Thanks
    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      At the end I've figured it out

      issue.customFields."CustomField".value = [nodeHelper.getUserByUsername("Username1"), nodeHelper.getUserByUsername("Username2")]


      Thanks for the help

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Samuel Bartolome

        Check following document How to synchronize list custom fields

        Let me know

        1. Samuel Bartolome

          Hi,
          I believe the option I'm looking for  is below, however I don't seem to understand the last part of the code from the + sign

          nodeHelper.getOption(issue, "Multi Select Custom Field name", "MY STATIC OPTION")

          Set an option value manually into the local custom field 

          1
          2
          3

          issue.customFields."Multi Select Custom Field name".value =
                          (issue.customFields."Multi Select Custom Field name".value ?: []) +
                              nodeHelper.getOption(issue, "Multi Select Custom Field name", "MY STATIC OPTION")


        2. Francis Martens (Exalate)

          what is the error you encounter?

        3. Samuel Bartolome

          There is no error, however no data is populated into the field.

          How shall we proceed if we would like to add 2 default values?

          Thanks

        4. Francis Martens (Exalate)

          You can always inspect the values and the flow of the script by adding


          throw new Exception("Result - ${nodeHelper.getOption(issue, "Multi Select Custom Field name", "MY STATIC OPTION")}")

          This will provide you a way to look at the calculated value.

        CommentAdd your comment...