It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hi folks,
maybe a stupid question, but i don´t find what i´m doing wrong here:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue; issue.reporterId = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
This is a groovy scripted post function to change a cloned issues´ reporter to the current user (instead of the reporter of the to be cloned issue), after changing from componentManager to ComponentAccessor this is in general working.
But, while testing it it looks a bit weird:
image2017-1-4 18:22:58.png
You see, the assignee was cloned and the correct name was set, but the reporter was somehow changed to the username instead. Tried to find a solution by myself but without success...
Many thanks!
Your assigning an com.atlassian.jira.user.ApplicationUser object in JIRA 7 or a com.atlassian.crowd.embedded.api.User object in JIRA 6 to the reported id.
The reported id should be the username. So you need:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.MutableIssue; issue.reporterId = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser().name
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.