we have one requirement i.e
when in Parent Jira ticket which is story issue type in workflow if we click a fail transition it should create new issue type Bug. which is completed .
but what i am looking here when new issue created which is bug(Child) the newly created child ticket summary has to be copied as a comment to parent ticket
is that possible ?
my automation plug in was expired we have JSU, Script runner and Jira Misc plugin.
Hi @CHINNAMUTHEVISAI.SATYANARAYANASHARMA You can do this easily with the help of JSU plugin. Use Post function >> Copy field value.
Select Issue relation Linked issue >> select the link type
Copy field Summary to ***new comment***
Try this it should work.
Applied same on parent workflow but getting comment on child case.
this post function has to be applied on parent ticket or child ticket ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @CHINNAMUTHEVISAI.SATYANARAYANASHARMA Yes, post function should be on parent issue. It seems that you selected the wrong issue link relation. Check issue link relation, select correct link type.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
applied same post function on parent workflow still its not getting commented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
May I know which link type are you using when creating child bug issue ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry for commenting from other account
That's also done before raising this ticket but not working too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Move post function after child issue creation post function.
Bug is a link type, right ?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tested on my side using Parent/Child Link type. it's working fine. Comment is adding on Parent issue (Story). It seems that you are doing something worng in issue lik relation in post function. Please make sure, Add comment post function must be after create issue post function.
Thanks
V.Y
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks
In place of is parent of bug should be added right ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vikrant,
it's working fine for me at the moment but i need a default format that needs to be generated when bug(child) has been created in parent ticket.
at the moment child ticket summary has been copied as a comment in parent ticket but the required format is like this
Ex- A new bug has been created
Reference: SF-1234 ( newly generated child issue key)
Summary: Unexpected item in the bagging area.
is that possible ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@CHINNAMUTHEVISAI.SATYANARAYANASHARMA It's not possible to add Issue key in a comment using JSU automation suite. Kindly use Scriptrunner post function to add custom comment on an issue.
Add a comment to this issue [ScriptRunner]
OR
Adds a comment to linked issues when this issue is transitioned [ScriptRunner]
Thanks
V.Y
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Vikrant,
can you mention the script if possible.
we are able to match our requirement here.
but we are getting two comments one is with issue summary and other is with newly created issue key can we combine both and add as a one comment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to add Custom scripted post function of adding comment having linked issue key and bug summary :-
Kindly check link type of Bug in issue linking, if it's Outward change getInwardLinks to getOutWardLinks and change commentBody as per your requirement.
import com.atlassian.jira.issue.link.IssueLink
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.CommentManager
def issueManager = ComponentAccessor.getIssueManager()
def commentManager = ComponentAccessor.getCommentManager()
def issueLinkManager = ComponentAccessor.issueLinkManager
List allOutIssueLink = issueLinkManager.getInwardLinks(issue.id);
for (Iterator outIterator = allOutIssueLink.iterator(); outIterator.hasNext();) {
IssueLink issueLink = (IssueLink) outIterator.next();
def linkedIssue = issueLink.getSourceObject();
def bugkey = linkedIssue.getKey()
String issueName = linkedIssue.getSummary()
// dispatch an event after creating the comment
final boolean dispatchEvent = true
// the body of the comment
final String commentBody = """New Linked issue has been created ${bugkey}
${issueName}"""
// the author of the comment will be the logged in user
def author = ComponentAccessor.jiraAuthenticationContext.loggedInUser
ComponentAccessor.commentManager.create(issue, author, commentBody, dispatchEvent)
}
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.