Display Service Offerings based on Incident Category

Nisha30
Kilo Sage

Hi,

 

In Incident Form, we do want to display list of only those Service Offerings , whose category = xxx (there is a field in SO table as string field) , matches with the incident category =xxx on the form.

 

example: If incident category = hardware, and in cmdb_ci_service table whichever records are having category = hardware, 

should be available.

 

Thanks

1 ACCEPTED SOLUTION

Hi @Nisha30 ,

then you can try putting this in the reference qual

ChaitanyaILCR_0-1750853775938.png

javascript:'category='+current.category;

 

Note: if there is a dictionary override for incident (OOB there is one) put this in the dictionary override record instead

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

View solution in original post

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Nisha30 

 

For this, you need to:

  1. First, add the category values at the Service Order (SO) record level.

  2. Update the logic of category and SO so that the SO becomes dependent on the category, similar to how we have category and subcategory dependencies.

https://www.servicenow.com/community/itsm-forum/incident-category-based-on-business-service/td-p/707...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Chaitanya ILCR
Kilo Patron

Hi @Nisha30 ,

 

ChaitanyaILCR_0-1750847308417.png

if it is 

javascript:(!gs.nil(current.business_service)? 'parent='+current.business_service: '');

 

update it as 

javascript:category=current.category+'^'+(!gs.nil(current.business_service)? 'parent='+current.business_service: '');

ChaitanyaILCR_1-1750847390932.png

 

please share your the dictionary override of service offering field of incident

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

 

HI @Chaitanya ILCR 

 

Service Offering form with OOB field CATEGORY

Nisha30_0-1750848749827.png

 

Incident form with CATEGORY

Nisha30_1-1750848812477.png

 

Service Offering Dictionary:

Nisha30_2-1750848926439.png

 

 

the script include looks like this

var displaytso = Class.create();
displaytso.prototype = {
  initialize: function() {
  },

  getTSORefQual : function(current) {
  var inccategory = current.category;
 var tsomatch = new GlideRecord('service_offering');
 tsomatch.addQuery('category',inccategory );
 tsomatch.query();
 while(tsomatch.next())
 {
    answer = tsomatch.sys_id;
    return 'sys_idIN' + answer;
  },
  type: 'displaytso'
};

Hi @Nisha30 

just put this in this in the reference qualifier

replace ":" with ":"

javascript:'category='current.category

are you sure that service offering category choices and incident category choices?

if yes you can replace ref qual with above mentioned

if no

how are they mapped service offering category and incident category values?

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya