Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog Requests

ArunG29061990
Tera Expert

Hi, 

We have a requirement to mention the different Business Services under one ServiceNow catalog. 

As of now, we are using the below-given scripting code so that free support case business services can be popped up when we create a new ticket via Catalog request. 

         current.business_service = gs.getProperty("bw.business_service.free_support_cases.sys_id");
 
but now the requirement is to use different business offerings. Example
In catalog we have 4 options to select:
1. Production A
2. Production B
3. Production C
   So If I choose Production A then "Business Service A" should be linked in ticket, If i choose production B then "Business Service B" should be linked.
 
I assume we need to replace "current." from the scripting but how? Any suggestion please 
1 ACCEPTED SOLUTION

Niklas Peterson
Mega Sage

Hi @ArunG29061990 ,

 

Current would be the record you are running the logic on. current.business_service would be a field called business_service on the same record. gs.getProperty is the code for fetching the value of a system property. In this case the system property called bw.business_service.free_support_cases.sys_id.

 

If you want to replace the logic to have different services depending on the option then it's the gs.getProperty logic that you need to replace with a mapping between option and service.

 

Regards,
Niklas

View solution in original post

1 REPLY 1

Niklas Peterson
Mega Sage

Hi @ArunG29061990 ,

 

Current would be the record you are running the logic on. current.business_service would be a field called business_service on the same record. gs.getProperty is the code for fetching the value of a system property. In this case the system property called bw.business_service.free_support_cases.sys_id.

 

If you want to replace the logic to have different services depending on the option then it's the gs.getProperty logic that you need to replace with a mapping between option and service.

 

Regards,
Niklas