In the service desk queue, there is a ticket which is raised by the client and we will be creating a linked issue for our internal use and both happens in the same instance. As of now if the client made an update we are copying it manually and pasting it in the internal ticket. I wish to automate that process. Could someone please help me on this.
This is also possible using the 'Automation for Jira' add-on. You may find that app easier to use than ScriptRunner as it has components and drop down boxes for building your rules.
You can create a rule that copies the comment from one issue to the other using something like this:
in the comment box , you could include text similar to this:
The following comment was added to the linked Jira issue: {{triggerissue.key}}: {{triggerissue.comment.last}}
this will pull the comment from the Jira issue and add it to the Jira service desk ticket's comment.
Hi @Jai Vijay ,
This automation not available out of box. If you are using scriptrunner plugin you can implement update listener to do comments on linked issue.
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.event.issue.AbstractIssueEventListener import com.atlassian.jira.event.issue.IssueEvent; public class CopyComments extends AbstractIssueEventListener { @Override void workflowEvent(IssueEvent event) { def linkedIssue = "PROJECT-1"; def commentManager = ComponentAccessor.getCommentManager(); def issueManager = ComponentAccessor.getIssueManager(); def comment = event.getComment() def targetIssue = issueManager.getIssueObject(linkedIssue); commentManager.create(targetIssue, comment.authorApplicationUser, comment.body, true); } }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the quick response. I will try this out and update you at the earliest. Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have installed the script runner and I tried running the above script in the script listener.
I received the error stating
"unable to resolved class com.atlassian.jira.component.ComponentAccessor"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.