I would like to add fixed text to user comment..For example when user press "cancel" button (on transition in workflow), i would like to run custom script runnner code that is going to add prefix - word "Cancel" - before the user comment.
When user cliked on Cancel - custom screen opened with requirmenet to enter reason for cancel, and comment...
Code that i am using is:
import com.atlassian.jira.component.ComponentAccessor
def commentManager = ComponentAccessor.getCommentManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()
commentManager.create(
issue,
user,
"CANCELLED",
false)
But the problem is that on transition i now have two lines in comments:
xxxxx yyyyyyy added a comment - 5 minutes ago
CANCELLED
xxxxx yyyyyy added a comment - 5 minutes ago
We decided to cancel issue
I would like to have just one line:
xxxxx yyyyyy added a comment - 5 minutes ago
CANCELLED - We decided to cancel issue