Service Catalog form update

Hi Team,

We have got one requirement to update the catalog item general details form section. Can anyone help us in updating it.

Thanks,
Venkat

Hi @venkatgupta,

Greetings!

I can’t see any API for this, perhaps we are missing something.

Let’s ask Freddy about this.

@Freddy, your thoughts on this?

Freddy said Hi @venkatgupta and @Bene_Immanuel,

Good day to both of you!

To update the catalog item general details form section, follow these steps:

  1. Navigate to the Service Catalog > Catalog Definitions > Maintain Items.
  2. Find the specific catalog item you want to update and open it.
  3. In the General tab, you will find the general details form section, where you can update the required information.
  4. Once you have completed the updates, click the “Save” or “Update” button in the form.

Please let me know if you need further assistance or if you have any additional questions regarding this process.

Best regards,
Freddy

Thanks for your response.

with provided solution we need to manually update all catalog items. But, the requirement is to update all catalog items general section at once.

@Freddy Is there a way to update all catalog item general section at one place?

Thanks,
Venkat

Freddy said Hi @venkatgupta,

Thank you for the clarification. My apologies for the confusion in my earlier response.

To update all catalog item general sections at once, we can create a script to achieve this. Here’s an outline of the process:

  1. Create a script to update the specific fields in the general section of each catalog item.
  2. Ensure the script iterates through all the catalog items you want to update and modifies the necessary fields according to your requirement.
  3. Test the script on a small number of catalog items to ensure it works as intended before executing it on the entire list.

Please find below a sample script that can be used to update catalog items:

var catalogItem = new GlideRecord('sc_cat_item');
catalogItem.query();

while (catalogItem.next()) {
  // Update the specific fields in the catalog item general section
  catalogItem.short_description = 'Updated Short Description';
  catalogItem.description = 'Updated Description';
  
  // Save the changes
  catalogItem.update();
}

Please customize the field values based on your specific requirement and test the script before running it on the complete list of catalog items.

Let me know if you need further assistance or have any questions about this process.

Best regards,
Freddy

@Freddy, I could see provided solution is for ServiceNow form update.

I am looking for FreshService solution. Kindly provide the solution for FreshService

Freddy said Hi @venkatgupta,

Apologies for the confusion earlier. To mass update the general section of catalog items in FreshService, you can utilize the FreshService API for updating service catalog items.

Here is the process on how to do that using the FreshService API:

  1. Retrieve all catalog items using the FreshService API endpoint: GET /api/v2/service_catalog/items
  2. Iterate through the catalog items, make the necessary field changes, and store the updated catalog items.
  3. Update the catalog items using the FreshService API endpoint: PUT /api/v2/service_catalog/items/:id

To achieve this, you can use a simple Python script. Kindly install requests library using pip install requests before running the script.

Here’s a sample Python script to update all catalog items in FreshService:

import requests

# Set your FreshService API Key and Domain
api_key = 'your_api_key_here'
domain = 'your_domain_here'

# Function to get all service catalog items
def get_service_catalog_items():
    url = f"https://{domain}.freshservice.com/api/v2/service_catalog/items"
    response = requests.get(url, headers={"Content-Type": "application/json", "Authorization": f"Basic {api_key}"})
    return response.json()

# Function to update a service catalog item
def update_service_catalog_item(item_id, updated_item):
    url = f"https://{domain}.freshservice.com

Dear @Freddy ,

My request was to update the catalog item general form section not to update catalog item records.

Freddy said Hi @venkatgupta,

Apologies for the misunderstanding earlier. To update the catalog item general details form section in FreshService, you’ll need to follow these steps:

  1. Login to your FreshService account as an admin.
  2. Navigate to Admin panel by clicking on the gear icon located in the top-right corner.
  3. Go to Service Catalog > Manage Catalog.
  4. Find the Service Category that contains the catalog items you want to update and click on it.
  5. Click on the catalog item you want to update.
  6. Here you will find the catalog item general details form section. You can update the fields as required.
  7. Save your changes by clicking on the “Save” button at the bottom of the form.

However, updating all catalog items’ general form section at once is not directly possible in FreshService. You will need to repeat the process for each item manually.

If you are looking for modifying a common field used in multiple catalog items, consider using “Form Fields” visible in every item. This way, editing the form field will reflect changes in all associated catalog items.

Please let me know if there is anything else I can help you with.

Best regards,
Freddy

With provided solution, we need to update each catalog item manually. But my requirement is to update catalog item general section at one place which should be available for all catalog items.