Map Reference Variable to RITM Reference Field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 04:32 AM
Good morning. I have searched for and read similar questions but none have helped me thus far. I have a workflow for a specific catalog item where they cite the application for the change. (FYI . . . we are not pursuing the change record producer avenue at this time, we want to keep it as a RITM.) This is a variable I setup as a lookup box referencing the cmdb_ci_appl table. I modified the RITM form to include the cmdb_ci field from the task table. In my workflow I would like to set the value since I cannot set this up as a record producer. I am able to successfully set the value of the short description via the workflow, but it is not setting the value for the CI. I have tried both of these and neither worked. How can I accomplish this?
current.short_description = current.variables.CCRshortdescription // copy request short description to item short description
current.cmdb_ci = current.variables.CCRchangeapp // copy variable app to be changed to ci
AND
current.short_description = current.variables.CCRshortdescription // copy request short description to item short description
task.cmdb_ci = current.variables.CCRchangeapp // copy variable app to be changed to ci
Most of my scripting is a trial and error based on examples I find, so I am certainly not a developer.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 04:42 AM
In your catalog Task activity, use below code in advance script.
task.cmdb_ci=current.variables.variable_name;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 04:55 AM
Hi Deepak. Unfortunately, that is not working. We do not have any tasks with this item. I am using the Run Script function for the RITM workflow. Does it matter that my lookup is using the cmdb_ci_cppl table (to limit to only application selection) and I am trying to map to the task table field cmdb_ci?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 06:22 PM
I have the same question - has anyone figured this out?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2017 10:47 PM
Then you can use the same code with your task object created. Table is not an issue as it is referring to base table cmdb_ci.
var NS= new GlideRecord("sc_task");
NS.initialize();
NS.u_short_description = current.variables.u_short_description;
NS.u_description = current.variables.u_description;
NS.insert();