How to display the summary of a Query issue linker custom field in an email

helie July 6, 2018

I have created a Query issue linker custom field named “Customer”  the custom field ID is 12100

I have a project CUS, in which each issue corresponds to a Customer, the Customer name is stored in the issue summary

Exemple : CUS-5230 has the summary BMW

 We use the issue type Ticket to log customer call.

During a Ticket creation,   Jira asks for the custom field “Customer”  to select one customer name in the list of customers (coming from the project CUS). This is very efficient and we get a list of customers  following the format: CUS-YYY name1 

                           

After the Ticket creation, Jira triggers a notification by email. We need to display  the customer name in the email.

But for the moment, I can get only the id of the customer in the project CUS (CUS-YYY) instead of the name.

This is logical, as the custom field “Customer” contains CUS-YYY .

But it is not convenient, as the email recipient needs to read the customer name, which is the summary of CUS-YYY

 

I’m using velocity template to customize the emails. But it seems the only variable I can request in this template is the current issue.

Is there a way to get the summary of the custom field in the email template ?

 

Here is the current velocity template we created

#disable_html_escaping()

 

#if ($issue.getCustomFieldValue("customfield_12100") && $issue.getCustomFieldValue("customfield_12100").length() != 0)

              

               #set ($CustomerCF = $issue.getCustomField("customfield_12100"))

               #set ($CustomerKey = $issue.getCustomFieldValue($CustomerCF) )                                  

               ## I tried these syntaxes but it doesn’t work

               ##set ($Customer = $CustomerCF.getSummary() )

               ##set ($Customer = $CustomerCF.getSummary($CustomerKey) )

               ##set ($Customer = $CustomerCF.getCustomFieldType().getSummary() )

               ##set ($Customer = $CustomerCF.getCustomFieldType().getSummary($CustomerKey) )

              

               ## the following lines give as a result:  CustomerKey: CUS-YYY

               <th>#text("CustomerKey"):</th>

               <td>$CustomerKey</td>

               ## the following lines give: as a result: CustomerCF: Customer

               <th>#text("CustomerCF"):</th>

              <td>$CustomerCF</td>

               ## using the following lines I would like to get: Customer: name1 but doesn’t work

              <th>#text("Customer"):</th>

               <td>$Customer</td>

               

</tr>

              

#end

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events