I've coded up a simple example for you to use here:
import com.atlassian.jira.component.ComponentAccessor //Get appropriate managers/handlers def commentManager = ComponentAccessor.getCommentManager() def authContext = ComponentAccessor.getJiraAuthenticationContext() //Define currentUser because it is not an available default def currentUser = authContext.getLoggedInUser() //Add comment to issue transitioned. The name on the comment will be the current user's name. //The boolean value delegates whether or not an event is fired. commentManager.create(issue, currentUser, "This is where the comment goes!", true)
Steps to use in transition:
The script that I provided above is a very simple example, but you can add more complex properties to the comment or add make a default user to be the commenter if you like (etc...). You can see other possible methods to use in the JIRA API.
As a Belgian, beer-lover and home brewer, beer is one of my great passions. I love the fact that with just a few ingredients (usually just water, hop and malt) you can create so many different tastes...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot