Is there any way to change the "creator" system field using the JIRA JAVA API. The background: the user should be able to create an issue which should be visible as anonymous within the system. So the reporter field can be easily changed during creation to some technical user called "anonymous", but still the "creator" field is set to the current user, who created the issue and this information is visible in the change history.
So one approach would be to change the creator within a post-function, e.g. script-runner, but how?
Hi!
A solution for changing the Creator field during issue creation would be to switch the AuthenticationContext to the anonymous user within a post-function. This can be implemented by using ScriptRunner and a Custom script post-function with the following code:
import com.atlassian.jira.component.ComponentAccessor def userManager = ComponentAccessor.getUserManager() def user = userManager.getUserByName("<anonymous_username>") def authContext = ComponentAccessor.getJiraAuthenticationContext() authContext.setLoggedInUser(user)
It is very important that this post-function must be executed before the post-function (named: "Creates the issue originally.") which creates the issue.
These can be done in 2 ways:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi gabrielle, what I need is to update the creator field to a technical user, the creator system field is not equal to the assignee. I understand completely your approaches and they are absolutely fine, but does not macht my use case. The creator field is not visible on the GUI, just in the change history of an issue. BTW, is also not the reporter. See: https://answers.atlassian.com/questions/307400/creator-field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tim Eddelbuettel There are multiple solutions to this:
We have used 2) as for our needs it was the best solution.
Greetings, alex
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@david kreuter: Did you find a solution for this?
I think i will create a hidden transition and trigger this with JIRA Automation as another user. I think this will work. Also for the created issue link.
Regards,
Tim
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.