Forums

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

How to import CSV on JSM ASSET with multiple Asset on one Attributes linked to asset also

RAMCEL MAGNAYE
Contributor
January 21, 2025

 

How to import CSV on JSM ASSET with multiple Asset on one Attributes linked to asset also

Like on the photo below but on CSV format :  1.png

2 answers

2 accepted

4 votes
Answer accepted
Robert DaSilva
Community Champion
January 22, 2025

Hi @RAMCEL MAGNAYE , I think I have a solution that may work.

First, there are going to be a few things to call out as important:

  1. You will need two separate import configurations, that achieve different results:
    1. Import 1 is to import Laptop data only. This includes the Laptop identifier, and any other metadata you care about.
    2. Import 2 is to import Employee data. This includes the Employee name, ID, and any other metadata you care about. This import will also link previously imported laptops to individual employees.
  2. The CSV for your Laptops should have one row for each LaptopScreenshot 2025-01-22 at 2.06.11 PM.png
  3. The CSV for your Users should have one row for each employee
    • If an employee has more than one laptop assigned, enter each in a single field and use the double pipe "||" to split each entryScreenshot 2025-01-22 at 2.04.57 PM.png

In order to accomplish this, we'll need to configure a few things.

  • Inside your Laptop Object Schema configuration, add metadata attributes for all metadata items you want to track. Some recommendations might be Manufacturer, Warranty End Date, Operating System, etc.Screenshot 2025-01-22 at 2.07.30 PM.png
  • Inside your User Object Schema, ensure you have an attribute for the Laptop, configured to allow unlimited entries. In addition, this attribute should be configured as follows:
    • Type = Object
    • Type Value = LaptopScreenshot 2025-01-22 at 2.07.58 PM.png

Once all of that is complete, we'll want to configure our two import configurations.

Laptop Import

  • This import is pretty straight forward, assuming you do not want any linked fields.
  • Configure each column as you see fit, or view the example below.

Screenshot 2025-01-22 at 2.02.39 PM.png

Employee Import

  • This import is more complex
  • For the Laptop entry, we must tell Assets that this field has multiple values, and to treat it accordingly
    • Set the Data Source Field to the Laptop filed in the CSV
    • Set the Destination Attribute to the Laptop Attribute on the User object
    • Enter the following in the AQL: Label IN (${Laptop${0}})
      • Label -> This is referencing the primary key, or label, of the linked object. In this case, it's the Laptop object, and the Label should be the laptop identifier. 
      • IN (${Laptop${0}}) -> This is telling Assets to match the previous Label to the values inside of the CSV Column titled "Laptop"
    • Enter the following in the Concatenator field: ||
      • This tells Assets that this field has more than one entry, and each entry is separated by the || characters.

Screenshot 2025-01-22 at 2.10.02 PM.png

Once all of this is done, import data from the Laptop Import Configuration first, and then secondly import the Employee data. If everything goes well, you should see the following:

Screenshot 2025-01-22 at 2.16.20 PM.png

 

If this helped, please make sure to accept the answer I have provided.

Cheers,

Robert

RAMCEL MAGNAYE
Contributor
January 22, 2025

Thank @Robert DaSilva you saved me :)

Like Robert DaSilva likes this
Robert DaSilva
Community Champion
January 23, 2025

Happy to have helped!

Like RAMCEL MAGNAYE likes this
Meghana Joshi
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 9, 2025

Hi Robert, I have followed the steps narrated above and tried creating schema for Laptops & Employees too. However, it gives all the attributes as text field and cannot create reference for Laptop to Employee. Can you suggest the way around it ? Thanks in advance.

Robert DaSilva
Community Champion
April 9, 2025

Hi @Meghana Joshi , when you create the attributes you need to change the Attribute Type to an Object, and then you can select the reference type you want to use.

0 votes
Answer accepted
Robert DaSilva
Community Champion
January 21, 2025

Hey @RAMCEL MAGNAYE , great question!

From your screenshot, it looks like you have an "Employee" object which is holding the following information:

  • Employee Name
  • Employee Number
  • Laptop(s) assigned to that Employee

 

It also looks like the Laptop entry is a set of objects too. I wonder, are these stored as part of a different Object inside your Assets configuration?

 

If you're able to share the following, that will help finding a solution specific to your needs:

  • Either a screenshot or a typed hierarchy of your Assets object tree
  • An example of the CSV you're trying to import
    • (please remove personal identifiable information from this example)

 


 

I have done something similar to what you're looking to accomplish, which I understand to be having a single Object (the employee in this case) be linked to multiple other objects as related.

 

The way I have done this in the past is similar to your implementation, but I accomplished this through importing two CSV files instead of one.

 

The first CSV file would be for the list of employees. This would contain the full name, and employee ID.

The second CSV file would be the list of Laptops. This would include any information about the laptops themselves, such as serial numbers, product model, issue date, etc. In addition, one specific field would be the employee the laptop is assigned to.

 

The benefit of importing this information through two CSV files is that

  1. you keep the list of employee data separate, and only update this when employees join or leave, or specific data needs to be changed
  2. you can upload the laptop data more frequently, without fear of impacting employee information

This will require the Laptop Object be set up such that the "Assigned Employee" is a referenced field, but that isn't overly complex to set up.

 

Once the two imports happen, the laptops should appear on each employee object, as assigned. And the individual laptop object will show the employee it is assigned to.

 


Again, if you can share more specifics about your current setup, I should be able to help ensure you can get this working.

Hope that helps,

Robert

RAMCEL MAGNAYE
Contributor
January 21, 2025

sample 01.pngim following this format 

RAMCEL MAGNAYE
Contributor
January 21, 2025

if i made chages it did not effect  for example i add laptops on one eployee from 3 laplops to 4 uing templates 

RAMCEL MAGNAYE
Contributor
January 21, 2025

sample.png

RAMCEL MAGNAYE
Contributor
January 21, 2025

format.png

RAMCEL MAGNAYE
Contributor
January 21, 2025

structure.png

Robert DaSilva
Community Champion
January 22, 2025

@RAMCEL MAGNAYE Oops, I meant to provide a reply here, but ended up making it a new answer. Either way, I think I found a solution for you.

Like RAMCEL MAGNAYE likes this

Suggest an answer

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

Atlassian Community Events