- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 09:08 PM
Hi,
There's a mandatory field value I need to capture from catalog task ticket when close, after that I need that field value to store back into the parent RITM ticket (which is the current) in order to write that value into a table, how can I copy the value of this same field from TASK to RITM in the workflow?
I added this line into the 'Create Task' stage and obviously it didn't work, after the TASK ticket is closed, can still see this cmdb_ci field on the RITM field as blank and still mandatory.
Regards,
Simon.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 10:53 PM
Hi,
Please refer below thread, it might helpful to you.
Mark it correct and helpful.
Thanks
Bhagyashri Sorte.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 10:09 PM
No SHarjeel. u_service_tag is just a 'String' field. And yes all other fields are inserted correctly, as you can see my screenshot.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 10:34 PM
Can you try below
var get_ci = new GlideRecord('sc_task');
get_ci.addEncodedQuery("request_item", current.getValue("sys_id"));
get_ci.query();
if (get_ci.next()) {
current.configuration_item = get_ci.cmdb_ci;
current.update();
}
var upd_inv= new GlideRecord("u_hardware_inventory");
upd_inv.addQuery('u_service_tag', current.configuration_item.getDisplayValue());
upd_inv.query();
var createInv = true;
while(upd_inv.next())
{
gs.info("SIMON CI While - " + current.configuration_item.getDisplayValue());
upd_inv.u_sys_user = current.u_affected_contact.getDisplayValue();
upd_inv.u_emp_id = current.u_affected_contact.employee_number.getDisplayValue();
upd_inv.u_location = current.u_affected_contact.location.getDisplayValue();
upd_inv.u_emp_status = current.u_affected_contact.active.getDisplayValue();
upd_inv.u_monitor = 2;
upd_inv.update();
createInv = false;
}
if (createInv)
{
var gr = new GlideRecord('u_hardware_inventory');
gr.initialize();
gs.info("SIMON CI - " + current.configuration_item.getDisplayValue());
gr.u_service_tag = current.configuration_item.getDisplayValue();
gr.u_sys_user = current.u_affected_contact.getDisplayValue();
gr.u_emp_id = current.u_affected_contact.employee_number.getDisplayValue();
gr.u_location = current.u_affected_contact.location.getDisplayValue();
gr.u_emp_status = current.u_affected_contact.active.getDisplayValue();
gr.u_monitor = 2;
gr.insert();
}
Let me know what you get in the logs.
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 10:42 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-07-2020 10:52 PM
You are right. OOB its configuration_item. Anyhow, have you try placing the logs, and did you get the value there for cmdb_ci?
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2020 12:56 AM
Hi Sharjeel, no luck, the gs.info showing empty value.