How to access Fulfillment group of the catalog item with the record producers

mcadieux
Kilo Contributor

Salut,

I have a incident record producer and I would like to know (from the script section) how can I read the Fulfillment group catalog item field and populate the Assignment group of the incident.

1 ACCEPTED SOLUTION

Kalaiarasan Pus
Giga Sage

Are you referring the fulfilment group on item definition ?   If yes, the below script will work



var map = gs.action.getGlideURI().getMap();


if (map.get('sysparm_action') == 'execute_producer' && map.get('sysparm_id') ) {


  var getRecordProducerData = new GlideRecord('sc_cat_item_producer');


  if(getRecordProducerData.get(map.get('sysparm_id')))


  {


  current.assignment_group=getRecordProducerData.group;


  }


}



I haven't tried it on Service portal yet. I had written this for one of the threads and got the comment that it doesn't work for service portal.


View solution in original post

5 REPLIES 5

Chuck Tomasi
Tera Patron

Hi Marc,



I haven't done this yet, but have you tried using the script to do something like:



current.assignment_group = producer.fulfiller_group;


Kalaiarasan Pus
Giga Sage

Are you referring the fulfilment group on item definition ?   If yes, the below script will work



var map = gs.action.getGlideURI().getMap();


if (map.get('sysparm_action') == 'execute_producer' && map.get('sysparm_id') ) {


  var getRecordProducerData = new GlideRecord('sc_cat_item_producer');


  if(getRecordProducerData.get(map.get('sysparm_id')))


  {


  current.assignment_group=getRecordProducerData.group;


  }


}



I haven't tried it on Service portal yet. I had written this for one of the threads and got the comment that it doesn't work for service portal.


Thks Kalai,


That did the trick, the way I was doing it always came has undefined.


This worked from the "Try It" on the record producer but not from within Service Portal.  Any ideas on how to access the fulfillment group of the record producer when submitting through service portal?