Question

Unable to create service item custom_dropdown with sections via API v2

  • 17 April 2024
  • 0 replies
  • 23 views

I’m trying to create service catalog item custom_dropdown with sections via API v2
following Service Desk API for Developers | Freshservice but it has no examples or schema for sections object.

I was able to get it from json representation of other service item with dynamic sections that was created manually:

{
"service_item": {
...
"custom_fields": [
{
...
"field_type": "custom_dropdown",
"field_options": {
"isSection": "true",
"displayed_to_requester": "true",
"placeholder": ""
},
"choices": [
[
"Action1",
"Action1"
],
[
"Action2",
"Action2"
]
],
"sections": [
{
"name": "Action1",
"fields": [
{
...
},
{
...
}
]
},
{
"name": "Action2",
"fields": [
{
...
}
]
}
]
}
]
}
}

 

When I’m doing POST request to API to create new service item with same choices and sections, it is successfull and item is created but sections are empty:
 

{
"service_item": {
...
"custom_fields": [
{
...
"field_type": "custom_dropdown",
"field_options": {
"isSection": "true",
"displayed_to_requester": "true",
"placeholder": ""
},
"choices": [
[
"Action1",
"Action1"
],
[
"Action2",
"Action2"
]
],
"sections": []
}
]
}
}

 API documentation says that “custom_dropdown” is a supported custom_filed type but says nothing about sections

Why is it not accepting privided sections configuration? Is it possible?


0 replies

Join the Community or User Group to Participate in this Discussion

Reply