Copy Story comments into respective Epic in the Epic Comments

Facundo Rua March 15, 2022

Wondering if anyone has done a custom made script that takes the story comments and paste it on the Epic comments for any updates that are done on the Story. Wondering if any of you came across this and has solve it using a custom made script. 

 

Clearly this cannot be done using the Automation module within Jira or I have not been able to figure this out mainly because the Comment field is not available.

 

Any help will be appreciated. 

2 answers

1 vote
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2022

Hi @Facundo Rua and welcome to the community!

This can be done with automation:

  • TRIGGER: Issue Commented
  • CONDITION: Issue Type != Epic
  • BRANCH: Epic (Parent)
  • ACTION: Add Comment
    NOTE - This will create a new comment on the epic as Jira Automation, but will not capture other important details like the originating issue and author.  Here's an example of how I capture it:
    • *Issue:* {{issue}}
      *Author:* {{comment.author.displayName}}
      {quote}{{comment.body}}{quote}
Facundo Rua March 15, 2022

Thanks @Mark for this. This will create a comment based on the comment added in the Story when adding it correct? I will try this out now. Appreciate the help! 

Facundo Rua March 15, 2022

Hey @Mark Segall I might be doing something wrong. Completed the steps but this is not allowing me to continue on the Add coment... 

 

Picture1.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 15, 2022

You're not able to copy/paste what I had in my last comment into the comment area?

Ayush Lawania March 14, 2023

What would be smart value to return the story name where the comment was mentioned, {{issue}} displays the epic name not the story name where I added the comment.

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 14, 2023

Correct...  You caught a mistake in my previous message.  While in the branch, {{issue}} will capture the branch issue.  Instead it would be something like this:

*Issue:* {{triggerIssue}}
*Author:* {{comment.author.displayName}}
{quote}{{comment.body}}{quote}
Sue Estenson August 8, 2023

Hey @Mark Segall  I am trying to do this same thing and running into issues and think I have someone wrong. Here is how I have it setup - do you see anything that I need to fix? image.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 8, 2023

Hi @Sue Estenson 

Based upon your rule, it proceeds if it's an Epic and then attempts to branch into the Epic's Epic.  If your intent is that when a comment is added to a child issue that it copies to the Epic, you just need to change that first condition to issue type NOT equals Epic.

Sue Estenson August 8, 2023

Oh awesome, that is what I needed! It works now!! 

Like Mark Segall likes this
0 votes
Elliot Nevis
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 8, 2024

@Mark Segall 
@Mark Segall 
Thanks for your comments above as it has helped!

Can you explain why when "Issue type does not equal Epic" is not included in the workflow it only allows for one comment to be added to the epic, but then when "Issue type does not Equal Epic" is included, multiple comments can be added to the Epic?

Trying to think of a reason as to why but can't wrap my head around it!

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 8, 2024

Hi @Elliot Nevis and welcome to the community!

Branching can be a little awkward to wrap your head around at first.  For this specific question, they wanted comments from Epic children to copy up to the Epic so issue hierarchy is important. At time of trigger, the rule does not yet know if the comment was at the Epic level or the Story/Task/Bug level.

In this use case, we don't want to take action if the issue is an Epic so we add that first condition so it exits the rule when the issue that triggered is an Epic.  If this condition passes, we know its a child issue.

Now that we know it's a child issue, we need to get to our end state which is copying that comment up to its Epic. This requires a branch which tells the rule that it needs to switch its focus from whatever triggered the rule to its parent Epic. 

Finally, the rule has branched into the Epic and we can perform actions directly against the Epic which in this case is copying the comment from the issue that triggered the rule.

 

Suggest an answer

Log in or Sign up to answer