Hi all,
I want to add auto comment during a transition as a specific user.
I have this code successfully adding comment in the ticket but, as the current user.
Can you please help me to improve the code to add comment as a specific user? Eg: donotreply
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.comments.CommentManager
ComponentManager componentManager = ComponentManager.getInstance()
CommentManager commentManager = componentManager.getCommentManager()
commentManager.create(issue, transientVars.context.caller, "The Auto comment", false)
Thank you!
Below snippet should help
ApplicationUser user = ComponentAccessor.getUserManager().getUserByKey("user1")
commentManager.create(issue,user,"auto comment",false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.