Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
UI Text Box
sizemedium
typeinfo

Use case

In our When a new incident is created for a system managed in Jira Service Management projectAssets, we want to automatically send an automatic email notification is sent to the project lead to inform him of an incident in a system managed asset. 

UI Text Box
colorlight-yellow
icontip

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.You track your incidents in Jira and assign a Jira Service Management Asset field called Affected System to them when you create the issue. This field (in our example with the custom field ID 10049) should be configured as a single option field to allow accurate identification of the affected system for each incident. Each managed system has at least one defined Application Owner set as an asset attribute.

Configuration steps

UI Steps
UI Step

Get

Recipient

started and configure the recipient

Add the post function Send email post function to the Create transition in your Incident Management workflow. Keep the the Basic configuration. Edit To ensure the project lead is notified of newly created incidents, add them as a recipient by Select recipient → Add Field containing users → Project lead. 

UI Step

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.

Define the email subject

Code Block
titleSubject
ThereAttention: isNew an incident withof %{getNameFromAsset(%{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.

Expand
titleHow to get a custom the right field code?

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

UI Step

Set the email body 

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()functionYou 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.

Code Block
titleEmail format* -> HTMLBody
<p>
    Hi there,
</p>
  
<p>
 ThereA is a new incident with the issue key <a href>%<a href="%{system.baseUrl}/browse/%{issue.key}" target="_bank">%{issue.key}</a> has been created. TheHere, problemthe issystem with %{issue.cf10049.name} is affected. theThe Application Owner of this system 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>


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.

Image Modified Related Examples

Page properties report
firstcolumnUse case
headingsJWT feature, Workflow function, Parser functions, Complexity
sortByTitle
cqllabel = "use-case" and space = currentSpace() and ancestor = "38569498"

Page properties
hiddentrue


JWT feature

Workflow function

Send email

Parser functions

getNameFromAsset()

getAttributeFromAsset()

userDisplayName()

Label
Use case descriptionIn our Jira Service Management project, we want to automatically send an email to the project manager to inform him of an incident in a system managed asset. 
Complexity

Status
colourGreen
titleBeginner



Excerpt Include
DECADIS:Contact support
DECADIS:Contact support
nopaneltrue