Skip to main content
Skip table of contents

Set Insight fields using Elements Connect and Automation

Need: Set the value of an Insight field from a JSM request

In this context, IT operations engineers use a Jira Service Management portal to raise change requests on given assets. Such assets are managed in Jira Insight.

When raising a change request, IT engineers need to select the asset they are raising a change request for. Once the change request has been created, IT operations managers receive them and can process them. From an asset object in Insight, they need to be able to check if there are other conflicting requests impacting the asset in order to easily approve or reject change requests.


Solution: Push the value from a Connected item (asset name) to an Insight field to keep it in sync

Elements Connect fields can be used in the Jira Service Management portal so that IT operations engineers can select the following in their change request:

  • The asset type: laptops, printers, network switches, firewalls, etc.

  • The asset name based on the asset type selected

When the change request is created, the Elements Connect mirror field for the “Asset name” field is then pushed to the Insight field “Affected asset”, setting its value to the selected asset. Configuring a simple Automation rule enables to keep the Insight field value in sync with the asset name selected in the change request in the event it is later changed to a different value.

When the change request is raised with the above fields selected, IT operations managers can process it easily without having to manually change the Insight field “Affected asset”. Moreover, the change request issue is directly linked to the Insight object, helping them to keep track of all requests related to the asset in question.

Elements Connect in action

How to push connected item values to Insight fields and keep them in sync

Prerequisites:

  • Have Jira Insight and have Insight objects created in an object schema

  • Have an Insight field configured - in this example, it is called “Affected asset”

  • Have Automation

  • Have Elements Connect installed on your instance

Configuration steps

The configuration is done in 4 steps:

  1. Create and configure the Jira Insight REST API datasource in Elements Connect

  2. Create and configure Connected items in Elements Connect to retrieve asset types and asset names from the Jira Insight datasource

  3. Associate the Connected items to a request type in your Jira Service Management project

  4. Configure the Automation rule to update the Insight field “Affected asset”


Steps

1- Create and configure the Jira Insight REST API datasource in Elements Connect
  • Go to Elements Connect administration by clicking on “Apps”, then Elements Connect

Access Elements Connect  from Jira main page

The first step is to create a REST API datasource.

  • Click “Create datasource” and select REST API.

Elements Connect - Create datasource

  • Enter a name for your datasource, then configure the relevant fields:

Insight datasource configuration

Atlassian - Create API token

    • Click the “Test connection” button

Elements Connect - Connection tester

  • Save your datasource configuration.


2- Configure Connected items in Elements Connect to retrieve asset types and asset names from the Jira Insight datasource

What is a Connected item? As our documentation mentions, a Connected item can be seen as a sort of connected custom field.

In this tutorial, we are going to create 2 Connected items:

  • Asset type

  • Asset name


First Connected item - Asset type

Create one Connected item called “Asset type” of type Select list. Set Insight (or the name you gave to the datasource configured previously) as the Connected item datasource.

Elements Connect - Asset type configuration

REST endpoint: empty

Asset type - REST endpoint

CODE
/objectschema/3/objecttypes/flat

Location of the Connected item options in the response: leave empty

Display template: 

Asset type - Template

CODE
${(row.name)!}


The REST endpoint queries all the object types of the object schema whose ID is 3. To illustrate this more clearly, the Insight object schema looks like this:

Insight object schema explained


Second Connected item - Asset name

Now create a second Connected item called “Asset name” of type Select list using the exact same datasource that will display the asset names matching the selected “Asset type”. In other words, this Connected item is dependent on the value of the first Connected item “Asset type” (referenced as $issue.connected_item_10003 in the query below).

Make sure you tick the “Create the associated mirror field” option when creating your Connected item (see screenshot below).

Mirror field creation option


Asset name configuration


REST endpoint:

Asset name - REST endpoint

CODE
/iql/objects?iql=objectType="$issue.connected_item_10003"


Location of the Connected item options in the response:

Asset name - Location of item options in the response

CODE
objectEntries


Display template:

Asset name - Display template

CODE
${row.label}


Your Connected items are now up and running. The next step is to add them to your Service Management project.


3- Associate the Connected items to a request type in your Jira Service Management project
  • Go to your Jira Service Management project administration, and find the Connected item section.

  • Add both Connected items to the desired request type (for example: Report broken hardware)

  • Open the request type in the customer portal (you can use the button in the top right of your screen)

Elements Connect - Project administration


You can see both connected items on the form:

JSM form with Connected items


  • Select an asset type, asset names corresponding to this asset type will display automatically.

JSM form - Connected items dynamic display


4- Configure the Automation rule to update the Insight field “Affected asset”

At this stage, you’ve added your Connected items to your Jira Service Management request form. So customers will be able to select values for the Connected items directly from the request.

Now, we want to push any value selected for the Connected item “Asset name” to the Insight field “Affected asset” that you previously configured on your Jira Service Management project (refer to prerequisites). By doing that, the “Affected asset” Insight field value will be in sync with the Elements Connect “Asset name” Connected item.

This can be done easily by creating a project rule in Automation.

  • Go to the Project settings of your Jira Service Management project

  • Click “Automation”

  • Create the following rule:


Trigger:

Automation rule - Trigger


Action:

Automation rule - Action

This what this rule means: When the value changes for the mirror field “Asset name” (Connected item mirror field), then edit the Insight field “Affected asset”.


  • Enable the rule

  • When you go back to the created change request, the Insight field has been set based on the mirror field of the Connected item “Asset name”

    Issue view - Insight field set


  • From Insight, the change request ticket displays in the “Connected Jira issues” section in the right-hand corner of the Insight object:

Insight object - Connected Jira issues

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.