How to include associated business hours of a ticket in filter API

Hi team,

Is there a way to include the associated business ID in the filter API?

When I view a ticket API I am able to get the applied_business_hours key which holds the business ID.

But when I use the filter API I can’t view this key.

Is there any way to include this key in the payload?

also, the payload is not updated in the sample payload section.

Thank you.

1 Like

Hi @Bene_Immanuel,

This would need to be addressed at the API by Freshworks developers’ level to include those properties in the returned payload. To provide an example for clarity, you can see the payload for a direct ticket call and with a filter and there are actually numerous deltas:

Direct Ticket                  Filter Ticket
-----------                   -------------
bcc_emails                    <=
sla_policy_id                 <=
applied_business_hours        <=
urgency                       <=
impact                        <=
attachments                   <=
created_within_business_hours <=
PS C:\Build> Get-FSTicket -id 540
                                                                                                                        
cc_emails                     : {}
fwd_emails                    : {}
reply_cc_emails               : {}
bcc_emails                    : {}
fr_escalated                  : True
spam                          : False
email_config_id               : 
group_id                      : 
priority                      : 1
requester_id                  : 21000418006
requested_for_id              : 21000418006
responder_id                  : 
source                        : 2
status                        : 2
subject                       : What’s wrong with my email?
to_emails                     : 
sla_policy_id                 : 21000057781
applied_business_hours        : 21000011791
department_id                 : 21000097763
id                            : 540
type                          : Incident
due_by                        : 9/6/2023 8:58:34 PM
fr_due_by                     : 8/30/2023 5:58:34 PM
is_escalated                  : True
description                   : <div style="font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; font-size: 14px; "><div>Hi Team,<br><br>I have been unable to send any emails since this morning. What’s going on?<br><br>Regards,<br>Andrea Smith</div><div><br></div><div>Hi Andrea Smith<br><br>Thank you for reaching out to us. Our team will look into this request and get     
                                back to you shortly. You can check the status of your request and add comments here: <a href="https://its-fine.freshservice.com/support/tickets/540" rel="noreferrer">https://its-fine.freshservice.com/support/tickets/540</a><br><br>Regards,<br>Support Team</div></div>
description_text              : Hi Team,  I have been unable to send any emails since this morning. What’s going on?  Regards, Andrea Smith     Hi Andrea Smith  Thank you for reaching out to us. Our team will look into this request and get back to you shortly. You can check the status of your request and add comments here: https://its-fine.freshservice.com/support/tickets/540  Regards, Support Team
custom_fields                 : @{major_incident_type=; business_impact=; impacted_locations=; no_of_customers_impacted=}
created_at                    : 8/25/2023 8:58:34 PM
updated_at                    : 9/14/2023 2:04:59 PM
urgency                       : 1
impact                        : 1
category                      : 
sub_category                  : 
item_category                 : 
deleted                       : False
attachments                   : {}
workspace_id                  : 3
created_within_business_hours : True

PS C:\Build> Get-FSTIcket -filter "tag:vpn"

subject          : Test Child Ticket on SR
group_id         : 
department_id    : 
category         : Hardware
sub_category     : 
item_category    : 
requester_id     : 21002318359
responder_id     : 
due_by           : 1/11/2024 9:55:22 PM
fr_escalated     : False
deleted          : False
spam             : False
email_config_id  : 
fwd_emails       : {}
reply_cc_emails  : {}
cc_emails        : {}
is_escalated     : False
fr_due_by        : 1/4/2024 6:55:22 PM
priority         : 1
source           : 2
status           : 5
created_at       : 6/19/2023 12:53:50 PM
updated_at       : 12/29/2023 9:55:22 PM
requested_for_id : 21002318359
to_emails        : 
id               : 509
type             : Incident
description      : <div>Child Ticket Getting an error that VPN version not supported.</div>
description_text : Child Ticket Getting an error that VPN version not supported.
workspace_id     : 2
custom_fields    : @{weather_server=; business_impact=; impacted_locations=; no_of_customers_impacted=; text_field=; lf_location=}

There aren’t any embeds or API additions that you can make to add those properties that the documentation provides. The only option currently would be to return the full ticket and filter it client side versus leveraging the filters.

Hey @Bene_Immanuel,

Thanks for connecting and giving me a better understanding of this issue, to help you with this ask, I’ve raised a support ticket on behalf of you.