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)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.