Versions Compared

Key

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

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 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.

UI Text Box
colorlight-yellow
icontip

Prerequisite

You track

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 Asset field called Affected System to those them when creating you create the issue. This field (in our exampe example with the custom field ID ID 10049) , should be configured as a single - option field to allow accurate identification of the impacted 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 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 Keep the basic Basic configuration as needed. To ensure the project lead is notified of newly created incidents, add them as a recipient by selecting Recipient Select recipient → Add Field containing users → Project Leadlead. 

UI Step

Define the email subject

Code Block
titleSubject
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.

Expand
titleHow to get the right field code?

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

<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>

UI Step

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.

Code Block
titleBody
<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 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.

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.

Code Block
titleSubject
There is an incident with %{getNameFromAsset(%{issue.cf10049})}. 
Expand
titleHow to get a custom field code

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

Image Removed

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.
Code Block
titleEmail format* -> HTML

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