Automatically add a comment when you create a task.

Hello!

How can we realize the automatic addition of the comment to the task?

2 answers

1 accepted

Hello,

You can do it if you add a simple groovy script as a post-function on the start progress transition. Here is an example:

 

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, "Your automatic comment", false)

1 vote

Generally, it's very odd to put a comment on an issue as you create it - comments are for a discussion, why wouldn't you just put what you want to talk about in the description?

Anyway, the short answer is "code".  You'll want to find/write a post function or listener that will run on "issue created" and add a comment.  As usual, I'd use the Script Runner to do it, but there are other scripting add-ons that could do it too I think.

 

I would also be interested what is the business logic behind commenting an issue right when it is created.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published Monday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

494 views 8 9
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you