Hello everyone,
Can you help me with a simple script in post functions section in the workflow? I hit a bug that when issues are created via email, I got in the history tab wrong user for the one who creates the issue:
"user_name created issue - date."
The problem is that this user doesn't have anything to do with the issue, no access, no nothing.
I found this and it describes exactly the issue I have: https://jira.atlassian.com/browse/JRASERVER-41322
Sadly, the discussion there ends up with "contact support" solution and that one expired for me.
So I started to search how to change the user name of the creator before the creation of the issue. Found this one:
import com.atlassian.jira.component.ComponentAccessor
def userManager = ComponentAccessor.getUserManager()
def user = userManager.getUserByName("<anonymous_username>")
def authContext = ComponentAccessor.getJiraAuthenticationContext()
authContext.setLoggedInUser(user)From: https://community.atlassian.com/t5/Jira-questions/How-to-change-creator-system-field-via-JAVA-API/qaq-p/239871
The thing is that it doesn't work, I change the user name with the desired one, preserving the :
("< >")Nothing changes, still the created issue is from a wrong user name. The script is created in that way: post functions -> add post function -> script post-function -> inline script -> ran before "Creates the issue originally." as instructed in the thread I found.
I am running jira 6.2.7 server edition. Will appreciate any help as I am sure the stupid one here is me. 
Best Regards,