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.
Hello everybody i would like to set the Assignee from a user picker custom field see code Below but nothing hapens
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
def cField=ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_10401")
def cFValue = issue.getCustomFieldValue(cField) as ApplicationUser
issue.setAssignee(cFValue)
Hello @Heiko Treuner
Where do you do it? In post functions, in listeners, in the console?
If it's a post-function it should be upper then 'Update change history for an issue and store the issue in the database.' function. In other cases, you should use issue update methods. For example
def issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.setAssigneeId("userName")
def updateValidationResult = issueService.validateUpdate(user, issue.getId(), issueInputParameters)
if (updateValidationResult.isValid()) {
issueService.update(user, updateValidationResult)
}
Hey thaks for ur answer i used it in the create post function and have it before 'Re-index an issue to keep indexes in sync with the database. ' but nothing happens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to move your function to the first place just before 'Creates the issue originally.' function
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok if found the reason by myself i have to do this below:
issue.setAssignee(cFValue.username.toString())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
how can we set the multiple assignee's in jira
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
def cField=ComponentAccessor.customFieldManager.getCustomFieldObject("customfield_10401")
With this snippet you get a specific field where you can do what you want e.q. set other fields like the asignee field. If th fetched value a user picker field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.