Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update support tickets endpoint part1 #991

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

AgaDufrat
Copy link
Contributor

@AgaDufrat AgaDufrat commented Jul 11, 2024

  • Use the comment property to set the Zendesk ticket description
  • Don't format ticket body in SupportTicket as those will be coming in formatted
  • Remove user_agent, if necessary it will be in the body

See commit messages for details. Tested in integration. This endpoint is not currently used.

Zendesk API reference: https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/

alphagov/support#1422


⚠️ This repo is Continuously Deployed: make sure you follow the guidance

Follow these steps if you are doing a Rails upgrade.

This was causing an error
   GdsApi::HTTPUnprocessableEntity: URL: http://support-api/support-tickets
   Response body:
   {"status":"error","errors":{"description":["can't be blank"]}}

The docs say to use `comment` instead.

https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#description-and-first-comment

"When creating a ticket, use the comment property to set the ticket description, which is also the first comment.
Important: Do not use the description property to set the first comment. The property is for reading purposes only. While it's possible to use the property to set the first comment, the functionality has limitations and is provided to support existing implementations."

Ticket Comments are represented as JSON objects. They have a multiple properties.
The comment string needs to be in the "body" property.
See https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/
We anticipate that the inbound API call will have the body formatted so we don't need to do it here.

`user_agent` attribute should also be removed from support_tickets_controller.
Since it requires update to the Pact test in a another repo it will be removed in a follow up PR.
@AgaDufrat AgaDufrat force-pushed the update-support-tickets-endpoint-part1 branch from 8d5397c to 029d633 Compare July 11, 2024 15:03
Copy link
Contributor

@deborahchua deborahchua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
The terms description/details kept confusing me during the initial implementation 😅

@AgaDufrat AgaDufrat merged commit 9be3c3c into main Jul 22, 2024
9 checks passed
@AgaDufrat AgaDufrat deleted the update-support-tickets-endpoint-part1 branch July 22, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants