I need to add some users on a multi-user custom field based on the selection of a combo box.
Right now, I'm adding the users manually to test my code in the following way and it works well:
def issueKey = 'OOOO-1'
def customFieldName = 'Business Owner(s)'
def dashboardOwners = [accountId: '34534534535', accountId: '5345345345']
put("/rest/api/3/issue/" + issueKey)
.header("Content-Type", "application/json")
.body([
fields:[
customfield_12534 : [dashboardOwners]
]
])
.asString()
But...
How can I add a new user into the 'dashboardOwners' variable?
I tried with
dashboardOwners.add(accountId: '346666')
But I got an error.
Any suggestions?