Display JQL Result in Custom Email Postfunction

Hi,

I would like to know if it's possible to send a JQL result and extract custom field values from the results using the 'Send Custom Email' post function.

Business Case:

One ticket will track a business workflow and this will trigger several emails along the workflow. However there are certain post function emails that have to be tailored based on a JQL result.

So the goal is to display the JQL result as a table in the email template with specific custom fields as the columns and the issues as the rows, basically what you can do when you search for issues in JIRA, and define the 'To'/'CC' based on custom fields from the issues that are a result of the JQL.

Currently I use this post function for other applications that involve only information from the ticket that is being used to generate the email and I have no issues with this case. However I would appreciate to see if my scenario is possible or not, and if possible to have some assistance in how to achieve it. 

Thanks,

Francisco

2 answers

This widget could not be displayed.

Hi Francisco,

The functionality you are describing seems to be better covered by a filter set to show the custom fields of your choice, subscribing to it afterwards.

Note this is JIRA native functionality so, if you can stick to it, you will avoid getting technical debt.

Besides, sending the email immediately with the filter subscription approach can also be triggered by a mouse click on Run Now:

run-now.png

Do you think this can work for you? If that's not the case, why?

This widget could not be displayed.

Hi Ignacio,

A subscription to a filter kind of covers the display of the required custom fields for the desired JQL, however it does not cover the need of having a customized list of recipients which is the goal. Based on the results from the JQL, certain emails will be obtained for the resulting tickets (assignee, custom field 1, custom field 2, etc.), hence the email won't be sent to a fixed group(s), but a variable one depending on the JQL result.

Thanks

Hi Francisco,

Filter subscriptions execute the filter's query one time for each user subscribed to it as if executed by such user.

This means that you can still cover your needs subscribing a large group of users (jira-users?) to a filter which includes something like:

(assignee=currentUser() OR cf[1]=currentUser() OR cf[2]=currentUser())

Just ensure you keep unchecked the checkbox 'Email this filter, even if there are no issues found':

subscription.png

Of course, if you could narrow the group of users to any other group(s) smaller than jira-users, it would be better.

As you were expecting the email to be sent during a transition, you may want to represent that condition in your filter by adding a JQL fragment similar to this one:

...AND status changed FROM 'In Progress' TO Done AFTER -15m...

Hope it helps.

Hi Ignacio,

Appreciate the suggestion, however having a fixed group is what I am trying to avoid. The reason is that the items in the query will be different every week, therefore changing the audience I want to notify. The audience will always be stakeholders from the specific tickets in the query result, so I just want this set of users to receive the email. 

i.e. Week 1 has a query with Tickets 1 - 5 with Persons A - E, so I just want the email to be sent to Persons A - E, not a fixed group that will contain Persons A-Z. 

Thanks for the help, if there is no way to accomplish what I am trying to do, I will definitely follow your suggestion. 

Regards,

Francisco Ayala

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 yesterday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

72 views 1 0
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