- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 11:02 AM
Hi ,
My requirement is once order the laptop using Service catalog . Once Laptop has been received then one of the teams has to respond to the task . Then the Laptop details like serial no . model all will be added to Assets table and assigned to the requested user ? How to achieve this ?
Thanks in Advance .
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 07:29 AM
Serial number would be a variable that you add to the Catalog Item, then only show it on the Catalog Task. If you run this script to create the CI before this Catalog Task, you can run a similar one after the task to update the CI record with serial number and whatever other information was added in that task, or wait to run the script until after the Catalog Task, and serial number would be added to the CI/Asset record that is being created similar to name, department, etc in my example
ci.serial_number = current.variables.v_serial_number; - or whatever your serial number variable is named.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2022 12:08 PM
Use a Run Script activity in the workflow, something like this - to create a CI, which then auto creates a corresponding Asset, or just create the Asset record if that's what you really want:
var ci = new GlideRecord('cmdb_ci_computer');
ci.initialize();
ci.name = current.variables.v_name;
ci.install_status = 4; // pending install
ci.operational_status = 2; // non-operational
ci.department = current.variables.v_department;
ci.owned_by = current.variables.v_owned_by;
ci.insert();
substituting whatever field names on the new record you want to populate with whatever variable names or static values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 07:19 AM
Hi BradBowman,
Thanks for your response . How can the serial number can given into the asset column from the team ? In detail the serial number comes after receiving the device .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 07:29 AM
Serial number would be a variable that you add to the Catalog Item, then only show it on the Catalog Task. If you run this script to create the CI before this Catalog Task, you can run a similar one after the task to update the CI record with serial number and whatever other information was added in that task, or wait to run the script until after the Catalog Task, and serial number would be added to the CI/Asset record that is being created similar to name, department, etc in my example
ci.serial_number = current.variables.v_serial_number; - or whatever your serial number variable is named.