You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I am trying to programmatically update a ScriptRunner Multiple Issue Picker field using Groovy:
Here is my code:
def customFieldManager = ComponentAccessor.getComponent(CustomFieldManager);
def user = ComponentAccessor.getJiraAuthenticationContext().loggedInUser
def customField = customFieldManager.getCustomFieldObjectByName("Field Name")
Issue addOne = ComponentAccessor.issueManager.getIssueByCurrentKey("ID-123")
Issue addTwo = ComponentAccessor.issueManager.getIssueByCurrentKey("ID-321")
Collection<Issue> lists = [addOne, addTwo]
MutableIssue myIssue = issue
issue.setCustomFieldValue(customField,lists)
When I pass in a String, it adds the single issue to the Multiple Issue Picker field but I require to add multiple issues in one go. I have also tried using IssueInputParameters to update the field but have had no luck
Any ideas what I'm doing wrong?
I was looking for the same solution and found the following to work using the link
String[] issues = ["MSD-5", "MSD-6"]
.addCustomFieldValue(fieldId,issues)
Referenced
https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.