I need to update a JSM Custom Asset Object in a Jira Cloud issue with many (100+) objects that i have in a csv file.
For example: I have aJSM Asset Object custom field called "Laptops" that the user can add objects to it by click on "+" sign and selecting a record from the displayed list. It is configured to display the "Manufacturer," "Model," and the "Serial Number" of each of each of the objects. How could i add many objects to this Asset Object field without having to click the "+" every time?
To add multiple entries to a JSM Custom Asset Object field in Jira Cloud without manual clicking, utilize the External System Import feature.
Begin by preparing a CSV file with necessary laptop information, including Issue Key, Manufacturer, Model, and Serial Number. Obtain your JSM Assets Workspace ID from an issue export and gather corresponding Object IDs for each laptop.
Format your CSV file with columns for Issue key, Summary (left empty), and Laptops, separating multiple entries with semicolons
(e.g., workspace_id:object_id1;workspace_id:object_id2). Navigate to Jira administration > System > External System Import, upload your CSV, and map columns accordingly.
More help can be found here - How to bulk update Assets Object custom fields via External System Import | Jira | Atlassian Documentation
Other options for consideration:
- Bulk edit existing Assets objects.
- Set up Jira automation rules for future updates.
- Utilize Marketplace apps like JXL for Jira for complex scenarios.
How to bulk update issues with Asset Object values... (atlassian.com)
- Leverage Jira's REST API for programmatic updates.
- Ensure necessary permissions for bulk updates and imports.
Hope this helps - Happy to help further!!
Thank you very much and have a great one!
Warm regards
I must be doing something wrong because it is not working for me.
My csv file header are: ISSUE KEY, SUMMARY, and LAPTOP
The first row looks like XXX-123, empty, 4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3388;4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3391;4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3398;4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3404;4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3414
I got this error in the log file:
2024-10-14 20:10:06,702 INFO - Importing issue: [externalId='autoid--6742571920979294355', summary='null']
2024-10-14 20:10:06,720 WARN - Cannot add value [ [
4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3388;
4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3391;
4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3398;
4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3404;
4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3414] ] to CustomField ...
Probably value was in incorrect format
I also tried having each of the "workspace_id:Object_id" one per row in the csv file instead of separating them by ";" in one row.
That seemed to work but the issue now only shows the last row entry.
Thank you so much for your reply.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried importing a new csv file with just one entry "4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3414" and the Asset Object custom field changed from the previous Laptop object id to this new laptop object id. It acts like it can only hold one value unless that "+"sign is clicked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The Asset Object custom field in Jira appears to support multiple values when interacted with manually, indicated by the "+" sign for adding entries.
Then again, during the External System Import process, it's treated as a single-value field, overwriting existing values instead of appending new ones.
To resolve this issue, first verify that the custom field configuration allows multiple values. If correctly configured, utilizing the Jira REST API is the recommended solution, offering greater control over data updates.
This involves running a script for each issue, reading object IDs from your CSV file, to ensure accurate multi-value updates
python
import requests
import json
url = "https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}"
auth = ("your-email@example.com", "your-api-token")
headers = {
"Accept": "application/json",
"Content-Type": "application/json"
}
payload = json.dumps({
"fields": {
"customfield_10000": [
{"id": "4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3388"},
{"id": "4509ea7e-10c3-48a7-a4e9-e62459fc03ce:3391"},
# Add more objects as needed
]
}
})
response = requests.put(url, data=payload, headers=headers, auth=auth)
Best Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much! I had tried this method before without success, but I was not using the workspace id in the payload data for the custom field. That did the trick. Thanks for your help and the quick replies. You are awesome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Show up and give back by attending an Atlassian Community Event: we’ll donate $10 for every event attendee in March!
Join an Atlassian Community Event!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.