Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Prevent Duplicate Entries in Asset Schema When Recording Custom Field "Job Role"?

Bharat Kumar Bondalapati
Contributor
July 1, 2025

Hi Community,

We're using Jira Service Management and would like to ensure data consistency in our Assets schema when capturing job role information during user onboarding. Here's our setup:

  1. We have a custom field named "Job Role" in our onboarding request form.
  2. In Assets, we created an object schema called "User Details", which includes an object type named "Job Role" with an attribute called "Name".
  3. Since we don’t have predefined HR roles, we want to dynamically populate the "Job Role" object in Assets based on the values entered in the custom field during onboarding.
  4. However, we want to avoid adding duplicates. If a job role already exists in the "Job Role" object (based on the "Name" attribute), we don't want to create it again.

Question:
How can we compare the custom field value from the form (i.e., "Job Role") with existing values in the "Name" attribute of the "Job Role" object type, and only add it to Assets if it's not already present?

Would this require an automation rule, a custom script, or an integration with Automation for Jira or Insight APIs? Any examples or recommendations would be appreciated.

Thanks!

3 answers

1 accepted

1 vote
Answer accepted
Bharat Kumar Bondalapati
Contributor
July 2, 2025

@Geethanjali Katagani @Christopher Yen 

Thank you for all your inputs. I was able to achieve this using {{lookupObjects}}.

1. I used {{lookupObjects.(reference name).(attribute name)}} to access all the attributes of a object under a schema.

2. Then I used {{smart values}} condition to validate against the value entered in the custom field during filling up form to raise the ticket.

3. The {{smart values}} condition used is:
    First Value: {{#lookupObjects}}* {{Name}}{{/}}
    Condition: does not contain
    Second Value: {{issue.customfield_xxxxx}}

4. I have this in If-Else loop and works as expected.

 

Cheers
-Bharat

1 vote
Geethanjali Katagani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2025

Hi @Bharat Kumar Bondalapati ,

To avoid the creation of duplicate assets in the Asset schema based on the Name attribute, please follow the steps outlined below:

Step 1: Set the “Name” Attribute as a Label
This allows you to easily identify and search for assets by their name.

Steps:

-Navigate to Asset Schema (User Details) > Object Type (Job Role) > Attributes

-Select the Name attribute

-Click the three dots (•••) > Set as Label

Step 2: Mark the “Name” Attribute as Unique
This ensures that no two assets with the same name can be created.

Steps:

-Navigate to: Asset Schema (User Details) > Object Type (Job Role) > Attributes

-Select the Name attribute

-Click the three dots (•••) > Attribute Settings > Enable Unique

Step 3: Map Object Type to Custom Field for JSM
Create a custom field named Job Role in Jira and map it to the Job Role object type from Assets.
Once mapped, this field can be used in Jira Service Management (JSM) forms to allow users to select job roles directly from the Assets schema.

Let me know if you need any assistance with these steps.

Thanks,
Geethanjali

Bharat Kumar Bondalapati
Contributor
July 1, 2025

Hello @Geethanjali Katagani 

Thank you for your input!

However, I would like to create a object whenever user enters details in the custom field "Job Role" in the form.

So, I would like to compare the value entered in the custom field "Job Role" with that present in the attribute of an object type such that:

1. If the entered value is not equal to the value present in the attribute, then automation should create the object.

2. If the entered value is equal to the value present in the attribute, then automation should skip creating the object.

Geethanjali Katagani
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 2, 2025

Hi @Bharat Kumar Bondalapati ,

If you want to compare a custom field value with Job Role assets, you can try the suggestion below. Let me know if this works for you:

Create a short text field to store user input as the Job Role name. This field should be visible in the form view.

Then, create another field (e.g., Asset_Job Role) as an Asset-type custom field, and configure it to display Job Role assets in a dropdown. This second custom field does not need to be visible in the form view—you can hide it.

Next, create an automation rule in the same project to compare both fields when a ticket is created, and if necessary, create the Job Role object in the Assets schema.

Thanks,

Geethanjali

1 vote
Christopher Yen
Community Champion
July 1, 2025

Hi @Bharat Kumar Bondalapati ,

If Job Role is an object then you can go to the attributes for Job Role and set the Name attribute as unique. I'll include a screenshot below of how we set our Serial Number to be unique for workstations

2025-07-01 09_33_08-Object Schema - Hardware - Assets.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events