Hi,
Is it possible to add a list of linked issues into a scripted post function email template?
Thanks
It's perfectly possible but you will need to write some code.
Eg:
def issueLinkManager = ComponentAccessor.getIssueLinkManager() issueLinkManager.getOutwardLinks(issue.id).each {issueLink -> // filter on issueLink.issueLinkType.name out << issueLink.destinationObject.getKey() }
Matthew, just in case you're interested in Inward links as well (eg. "Is blocked by" vs "Blocks")
add this
issueLinkManager.getInwardLinks(issue.id).each {issueLink -> out << issueLink.sourceObject.getKey() }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried adding both of these to my template but it just outputs all of the above as plain text when the mail is sent...
Do I need to add any additional formatting to these?
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That was just the code. Here is what you put in the template. I'll leave it to you to include the summary etc:
...Other text... <% out << "Linked Issues\n\n" issueLinkManager.getOutwardLinks(issue.id).each {issueLink -> // filter on issueLink.issueLinkType.name out << issueLink.issueLinkType.outward << " " << issueLink.destinationObject.getKey() << "\n" } %>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The following will provide output like:
Blocks: In Progress [PR-198] Customer can export order history to Excel
issueLinkManager.getOutwardLinks(issue.id).each {issueLink -> def d = issueLink.destinationObject out << issueLink.issueLinkType.outward << ": " << d.getStatus() << " [" << d.getKey() << "] " << d.getSummary << "\n" }
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.