Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner in Jira Cloud: Modify Custom Multi-User-Picker-Field

Sven Odermatt March 28, 2025

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)

    }

}
If so - how do I define/reference "User1", "User2" correctly? 

Any hints would be greatly appreciated :) 

 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
3 votes
Answer accepted
Sayed Bares _ServiceRocket_
Community Champion
March 28, 2025 edited

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")

}
The way you are adding and removing options I dont it is supported
Sven Odermatt March 28, 2025

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 ;) 

TAGS
atlassian, confluence, loom, atlassian intelligence, ai notes, ai-powered meeting notes, atlassian community events, ace, confluence ai, loom ai integration, ai note-taking, atlassian ai features, team '25, atlassian live learning, confluence automation

Unlock AI-powered meeting notes: Join our live learning session! 📹

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!
AUG Leaders

Atlassian Community Events