Populate Configuration Item field on Catalog Task

Sandy7
Tera Expert

Hello, 

I have a service request that has a variable titled "computer_you_need_access_to"

On the Requested Item,  we have a field called "Configuration Item" (name is cmdb_ci) - that is an actual field on the top of the RITM. Then, on the catalog task there is also a field at the top called "Configuration Item" (cmdb_ci)

I have 2 requirements - one, once a service request is submitted, populate the cmdb_ci field on the RITM. I was able to accomplish this. 

The second requirement is to populate the cmdb field on the catalog task (from the value that the user entered on the service request form, which is already populated on the RITM). 

I am trying to do this using the "Advanced" field on the catalog task. 

I have tried all 3 of these variations below and none are working. Does anyone have any suggestions?

//task.cmdb_ci = current.variable_pool.cmdb_ci;
//cmdb_ci = computer_name_to_access;
//cmdb_ci = current.variable_pool.computer_name_to_access;
cmdb_ci = current.variable_pool.cmdb_ci;

1 ACCEPTED SOLUTION

Muhammad Khan
Mega Sage
Mega Sage

Hi Sandy,

 

Try this

task.cmdb_ci = current.variables.computer_you_need_access_to;

or

task.cmdb_ci = current.cmdb_ci;

 

Hopefully, this will work.

View solution in original post

7 REPLIES 7

AnirudhKumar
Mega Sage
Mega Sage

Hello Sandy,

Could you tell us where you are writing this script? A business rule? 

Hi I am using the catalog task activity in the workflow. There is an "Advanced" field where you can use scripting. 

find_real_file.png

try this:

current.cmdb_ci = current.request_item.configuration_item;

Edit (above is incorrect, use this):

task.cmdb_ci = current.request_item.configuration_item;

 

Hi, I tried that and it  did not work. It actually removes the value in the configuration item field on the RITM that was previously being populated. 

Thank you for helping