Copy Description from Catalog Item to RITM

tiyasa
Giga Expert

Hello everyone,

I need to copy the Description field on the Catalog Item form to the related RITM. I tried to write a BR after insert on the Catalog Item table

but it does not do any good.

Any help is appreciated.

Thanks in advance.

var gr = new GlideRecord('sc_req_item');

  gr.addQuery('sys_id', current.request_item);        

  gr.query();

  if(gr.next()){    

          gr.description = current.short_description;    

          gr.update();

      }

1 ACCEPTED SOLUTION

This did not work yet.



But , I found an alternative approach for my requirement, although it is not perfectly what it should be.Just a workaround.


I found the short description of the catalog is mapped to short description of the RITM, so i remapped this (from RITM) to the detailed description of the RITM in a run script of the workflow of the SC instead of the BR.


View solution in original post

9 REPLIES 9

Uncle Rob
Kilo Patron

Just making sure...


The description is on the Catalog Item... we're not talking about a description field on the form that the Catalog Item has when executed, right?


I guess it is   as the picture below :



find_real_file.png


Ok.   I *think* what you're trying to do is grab the Catalog Item's description whenever a Request Item (the result of a Catalog Item) is created.   If that's the case, you're not building in the right place.   You need to capture at time of Request Item creation, not Catalog Item.



What I'd do is place a runscript in the Workflow your Catalog Item triggers.   Within that runscript activity I'd place the following:



current.short_description = current.cat_item.short_description;



Though from a business perspective I'd recommend against this approach. Usually you want your RITM short descriptions to have some info specific to this particular instance of the request.   The Catalog Item's short description is easily retrievable by dot walking up the RITM's reference to Catalog Item


Thanks Robert. That is exactly what I was trying to achieve. And sorry, in the below answer of mine where I used alternate approach, that's exactly what i did. Got rid of the BR and put a script in the WF.