Copy the Request Item Variables to Catalog TASK fields

Kusuma2
Kilo Guru

Hi All,

I want to copy the variables present in the variable editor of Req Item Form to Catalog TASK fields.

How Can I achieve?

Regards,

Ajay.

1 ACCEPTED SOLUTION

Then you can write OnBefore BR - Insert on Catalog Task. But this will always run whenever the new Task is getting created or you can set the specific item in the condition

var gr = new GlideRecord('sc_req_item');
gr.addQuery('sys_id', current.requested_item); //RITM sys_id
gr.query();
while(gr.next()){
current.description = gr.variables.variable_name;
current.description += gr.variables.variable_name;
current.update();
}

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

 

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ajay,

I assume you are creating it from workflow in workflow for catalog task activity you can use the slush bucket and move the variables you want to be shown on catalog task.

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks for the Reply.

I dont want to update it via workflow. Because it is not specific to one workflow.

Shashikant Yada
Tera Guru

You can add the script under the Catalog Task Advance Script OR you can add the variables using sluch bucket, but that will show the variables on the task form


task.description = 'What is the Business Unit? '+current.variables.business_unit+'\n';
task.description += 'Name of the Company? '+current.variables.name+'\n';
task.description += 'What is the Contact ID? '+current.variables.contact_id+'\n';

 

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

Thanks for the Reply.

I dont want to update it via workflow. Because it is not specific to one workflow.