sc_req_item & request_item

ashleygreens
Giga Contributor

Hi Folks,

I have a question regarding Service catalog. I am trying to understand the difference between

sc_req_item     & request _item.   Can someone explain me the difference between the two.

Thanks,

Ashley

1 ACCEPTED SOLUTION

Hi Ashley,



The request_item is a column name in sc_item_option_mtom table which takes sys_id of the RITMs. That will help to filter out the GlideRecord of sc_item_option_mtom table to extract the data of a particular related records.


View solution in original post

14 REPLIES 14

Community Alums
Not applicable

'sc_req_item' is the task type (table name), and 'request_item' is the name of the reference field which points to the record on the sc_req_item table.



Is there a specific scenario you're trying to understand how these work?



Tim


Tim, i was trying to understand the below code thats where i got stuck with request_item.



  1. var task = new GlideRecord('sc_task');  
  2. //task.addQuery('assignment_group', 'd77c144f2b47308407ba65dee8da156d');  
  3. //task.addQuery('state', '!=', 3);  
  4. //task.addQuery('state', '!=', 4);  
  5. task.query();  
  6. while (task.next()) {  
  7.       var mtom = new GlideRecord('sc_item_option_mtom');  
  8.       mtom.addQuery('request_item', task.request_item);   (**** Why is he using request_item here )
  9.       mtom.query();  
  10.       while (mtom.next()) {  
  11.               gs.log('Task# ' + task.number + '/' + task.request_item.getDisplayValue() + '/Question:'+mtom.sc_item_option.item_option_new.question_text + '/Answer:'+mtom.sc_item_option.value);  
  12.       }  
  13. }  

Hi Ashley,



request_item is a column in sc_item_option_mtom table.


find_real_file.png


Good info Harsh, what is this mtom table, something new to me. I would love to learn about this