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.
---
Alternativ:
When a new incident is created for a system managed in Jira Service Management Assets, an automatic email notification is sent to the project lead.
----
mal was ganz anderes?
Access and make use of the attributes of an asset object that has been assigned to an issue.
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.
Alternativ:
You are tracking your incidents in Jira and assign a Jira Service Management Assets field called Affected System to those when creating the issue. This field (in our exampe with the custom field ID 10049), should be configured as a single-option field to allow accurate identification of the impacted system for each incident. Each managed system has at least one defined Application Owner set as an asset attribute.
Configuration steps
Get started and configure the recipient
Add the post function Send email to the transition. Keep the Basic configuration. Edit Select recipient → Add Field containing users → Project lead.
Aternativ:
Add the Send email post function to the Create transition in your Incident Management workflow. Customize the basic configuration as needed. To ensure the project lead is notified of newly created incidents, add them as a recipient by selecting Recipient → Add Field containing users → Project Lead.
Define the email subject
Attention: New incident of %{issue.cf10049.name}
In the subject line, we used the field code for the Affected System field, which has the ID 10049 in our example. Adding the .name
suffix retrieves the asset’s name instead of its key, allowing the project lead to directly identify the affected system.
Set the email body
You can choose to send the email in either plain text or HTML format. The following example, which you can adapt to your needs, is defined in HTML. If you want to use this example, ensure that the Email Format parameter is set to HTML.
<p> Hi there, </p> <p> A new incident <a href="%{system.baseUrl}/browse/%{issue.key}" target="_bank">%{issue.key}</a> has been created. Here, the system %{issue.cf10049.name} is affected. The Application Owner of this system is %{userDisplayName(getAttributeFromAsset(%{issue.cf10049}, "Application Owner"))} </p> <p> Cheers </p>
To insert information about the Application Owner, use the getAttributeFromAsset()
function. In this example, it returns the Application Owner asset attribute for the affected system specified in the issue as an Atlassian account ID. Since this ID is not easily readable, you can use the userDisplayName()
function to convert the ID into a readable name.
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.
There is an incident with %{getNameFromAsset(%{issue.cf10049})}.
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.
<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.