Hi community,
I'd like to update a customfield (type: multiuserpicker) via ScriptRunner/HAPI
"schema": {..
"items":"user",
"custom":"com-atlassian.jira-plugin.system.customfieldtypes:multiuserpicker"
...
}
Is it possible to use something like:
def eventIssue = Issues.getByKey('ABC-123')
eventIssue.update {
setCustomFieldValue(10xxx) {
add(User1)
remove (User2)
}
}
Welcome to the community @Sven Odermatt !
You should be able to use it by adding account IDs. However, for example:
def eventIssue = Issues.getByKey('ABC-1234')
eventIssue.update {
setCustomFieldValue(10xxxx,"5b147e52xxxxxxxxxxxx")
}
Great, that did the trick, thank you
In our example, it is possible that we have more than one user in this cf.
I ended up with this piece of code to update the cf
remainingUserIdsString = remainingUserIds.join(",")
logger.info('remainingUserIdsString: ' + remainingUserIdsString)
if (updateIssue) {
logger.info('updating Issue on cf 10xxx')
eventIssue.update {
setCustomFieldValue(10xxx, remainingUserIdsString)
}
}
Maybe helpful for other newbies ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you catch the news at Team ‘25? With Loom, Confluence, Atlassian Intelligence, & even Jira 👀, you won’t have to worry about taking meeting notes again… unless you want to. Join us to explore the beta & discover a new way to boost meeting productivity.
Register today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.