How to add a comment added during the transition of the parent issue as a comment on its linked issues
Requirement
As a JIRA Administrator, I want every comment entered on the parent to be copied onto the sub-tasks.
What should be achieved in the requirement?
- Fetch the comments provided during the transition of the parent issue.
- Copy the last entered comment on the parent issue to all its sub-tasks.
What do you need?
- JIRA Administrator login
- JIRA Misc Workflow Extensions plugin
Â
Â
How to do?
Â
- Click Edit for the workflow. In the Workflow Designer, select the transition you wish to configure the post-function on.
- Click onÂ
Post Functions
 in the properties panel. - Click onÂ
AddÂ
post-function
. - SelectÂ
Comment linked issues
 from the list of post-functions. - Select the link jira_subtask_outward from theÂ
Issue Link
 drop-down. - Select comment type as Raw Value from theÂ
Comment type
 drop-down. Input the following groovy script in the
Value
 field.com.atlassian.jira.issue.comments.CommentManager commentManager = com.atlassian.jira.ComponentManager.getComponent(com.atlassian.jira.issue.comments.CommentManager.class); commentManager.getLastComment(issueObject).getBody();
- Click onÂ
Add
 to add the post-function to the transition.
Â
What to test?
- Create an issue in the project.
- Create sub-tasks for the above created issue.
- Trigger the transition of the parent issue, on which the post-function is configured.
- Add a comment during the transition.
 The linked issues should be commented with the same comment entered for the parent issue.
Â