You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Use case

In our Jira Service Management project, we want to automatically send an email to the project lead to inform him of an incident in a system managed asset. 

Prerequisite

To record incidents, you need to have an active Jira Service Management Project. Each incident should include a custom field on its edit screen called Affected System, which is an asset object. The custom field code for Affected System is 10049 and will be used later. Ensure this is configured as a single-option field.

Configuration steps

Get Recipient

Add the post function Send email to the transition. Keep the Basic configuration. Edit Select recipient → Add Field containing users → Project lead. 


Email content

To display the name of the Asset stored in the Affected System field, use the getNameFromAsset() function. To get the correct field, use the Add field option and search for Affected System.

Subject
There is an incident with %{getNameFromAsset(%{issue.cf10049})}. 

Simply click Add field and search for affected system within the expression parser to find the correct custom field.


The sample mail can be customised to your needs. The Application Owner uses the getAttributeFromAsset() function, the Affected System custom field and the "Application Owner" Asset Attribute. This function returns an attribute value to give the name, here it is embedded in the userDisplayName() function.

Email format* -> HTML
<p>
    Hi there,
</p>
  
<p>
 There is a new incident with the issue key <a href>%{issue.key}</a>. The problem is with %{issue.cf10049.name} the Application Owner is %{userDisplayName(getAttributeFromAsset(%{issue.cf10049}, "Application Owner"))}

</p>
  
<p>
    Reporter: %{issue.reporter.displayName} <br>
    Assignee: %{issue.assignee.displayName} <br>
    Project: %{system.baseUrl}/projects/%{issue.project.key}" target="_bank">%{issue.project.name} <br>
</p>
  
<p>
    Cheers
</p>

Related Examples


If you still have questions, feel free to refer to our support team.