Question about "Send a custom email" Post Function and helper.issueTable Edited

Hi,

I configured the "Send a custom email" Post Function as follows so it includes "Linked Issues" in the email... 

Condition and Configuration:

config.a="issue in linkedIssues("+issue.key+")"

Email Template:

<b>Linked Issues:</b>
${helper.issueTable(a, 10)}

 

It successfully displays a table with the linked issues, BUT it shows ALL of the columns/fields that you would normally see in the JIRA JQL search results. Is there a way to limit the columns that display in the email? If not, is there another way to go about this? ...I only want to display a few fields (e.g. Issue Key, Summary, Status).

 

Thanks in advance!

1 answer

1 accepted

This widget could not be displayed.

I was able to resolve this by looping through the Linked Issues and building out the list of linked issues (Please excuse the code as I don't claim to be a developer by any means :)).

...I hope it helps someone else.

 <b>Linked Issues:</b> <br>

<ul>
<%

def outwardlinks = com.atlassian.jira.component.ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())
def inwardlinks = com.atlassian.jira.component.ComponentAccessor.getIssueLinkManager().getInwardLinks(issue.getId())
def oCounter=0
def iCounter=0


// Check for Outward Links...
if (outwardlinks)

for (id in outwardlinks) {
def linkedissueKey = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(outwardlinks[oCounter].destinationId).key
def linkedissueSummary = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(outwardlinks[oCounter].destinationId).summary
def linkedissueStatus = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(outwardlinks[oCounter].destinationId).status.name

out << "<li><a href='https://jira.domain.com/browse/"+linkedissueKey+"'>"+linkedissueKey+"</a> "
out << "("+linkedissueStatus+"):"
out << linkedissueSummary+"</li><br>"

oCounter ++
}


// Check for Inward Links...
if (inwardlinks)

for (id in inwardlinks) {
def linkedissueKey = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(inwardlinks[iCounter].sourceId).key
def linkedissueSummary = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(inwardlinks[iCounter].sourceId).summary
def linkedissueStatus = com.atlassian.jira.component.ComponentAccessor.getIssueManager().getIssueObject(inwardlinks[iCounter].sourceId).status.name

out << "<li><a href='https://jira.domain.com/browse/"+linkedissueKey+"'>"+linkedissueKey+"</a> "
out << "("+linkedissueStatus+"):"
out << linkedissueSummary+"</li><br>"


iCounter ++
}

%>

</ul>

 

I'm still interested in whether or not you can limit the columns/fields displayed in the results when using the following solution...

 Condition and Configuration:

config.a="issue in linkedIssues("+issue.key+")"

Email Template:

<b>Linked Issues:</b>
${helper.issueTable(a, 10)}

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

573 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you