Solved

Inserting values in a dropdown choice

  • 27 May 2021
  • 3 replies
  • 48 views

This is the description of my requirement:

  • When this happens (in Salesforce) - Trigger: New Account
  • Do this (in Freshdesk) - Action: Add a new dropdown choice on the custom field on every Ticket with the Account Name created from Salesforce.

Here is the JSON body:

Here is the error I get:

Is it possible to add a new dropdown value from API call or you need to select manually from Admin/Ticket Fields/ dropdown choices?

 Thx in advance!

icon

Best answer by Keer 27 May 2021, 13:32

Hello @Eli

 

I hope you are doing well today. I see you are trying to add a value to the dropdown field test here. You can do that with ticket field udpate API call. The value and the poisition of the field has to be passed in the payload for the choice to be added. 

 

For instance, the following API call would add email4 as an option to the dropdown field 82000275316 in position 4. 

 

To get the ticket ID to be used in the PUT call, you can use list All ticket fields API. All the fields would be returned from which you can get the ID associated with the dropdown field you are trying to modify. 

 

List all fields to get the ID of the field.

 

Once the choices are added, you can pass them in the create ticket API. 400 error would not be thrown then as the choices exists already. 

 

I hope this helps! If you have further queries, please post them here. 

View original

3 replies

Userlevel 4
Badge +2

Hello @Eli

 

I hope you are doing well today. I see you are trying to add a value to the dropdown field test here. You can do that with ticket field udpate API call. The value and the poisition of the field has to be passed in the payload for the choice to be added. 

 

For instance, the following API call would add email4 as an option to the dropdown field 82000275316 in position 4. 

 

To get the ticket ID to be used in the PUT call, you can use list All ticket fields API. All the fields would be returned from which you can get the ID associated with the dropdown field you are trying to modify. 

 

List all fields to get the ID of the field.

 

Once the choices are added, you can pass them in the create ticket API. 400 error would not be thrown then as the choices exists already. 

 

I hope this helps! If you have further queries, please post them here. 

Thanks for your answer, excellent answer!  I appreciate it.

Userlevel 4
Badge +2

Thanks for your answer, excellent answer!  I appreciate it.

I am glad we could help, Eli :) You can always reach out to us here if you need any further help with the same. Have a good day!

Reply