Skip to main content
Solved

Freshdesk API: update custom field

  • September 29, 2023
  • 3 replies
  • 1393 views

abren93
Apprentice
Forum|alt.badge.img

Hi,

 

I want to update a custom field using the freshdesk API.

This is the request I am making:

Fresh.tickets.update_ticket(freshdesk_id, custom_fields={'Some Field': some_value})

 

This is the response I get:

 

freshdesk.v2.errors.FreshdeskBadRequest: Validation failed: [{'field': 'Some Field', 'message': 'Unexpected/invalid field in request', 'code': 'invalid_field'}]

 

Best answer by abren93

Solved this.

View original
Did this topic help you find an answer to your question?

3 replies

abren93
Apprentice
Forum|alt.badge.img
  • Author
  • Apprentice
  • 2 replies
  • Answer
  • October 2, 2023

Solved this.


Davak
Community Debut
  • Community Debut
  • 2 replies
  • March 5, 2024
abren93 wrote:

Solved this.

Would you mind sharing how you solved this? I’m facing the same error message. Thanks.


Davak
Community Debut
  • Community Debut
  • 2 replies
  • March 5, 2024

Found the solution! (Now that I look at abren93’s post, they had most of the solution for my issue)

 

Instead of a PUT to https://domain.freshservice.com/api/v2/tickets/1234 with this body:
{ “my_custom_field”: 555 }

 

Use:
{ “custom_fields”: { “my_custom_field”: 555 } }

 

And to find the “name” of your custom field, make a call to https://domain.freshservice.com/api/v2/ticket_form_fields


https://community.freshworks.dev/t/struggling-to-create-a-servicerequest-with-customfields-using-powershell/7522


Reply