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

Check if requester is suspended before creating Zendesk ticket #1006

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

AgaDufrat
Copy link
Contributor

@AgaDufrat AgaDufrat commented Aug 8, 2024

It's not possible to create Zendesk ticket if a requester is suspended in Zendesk. The following error is raised:

  ZendeskAPI::Error::RecordInvalid:
  {"requester"=>[{"description"=>"Requester: <Name> is suspended."}]}
  (ZendeskAPI::Error::RecordInvalid)

We don't want to rescue ZendeskAPI::Error::RecordInvalid as this error is raised for other issue such as incorrect formatting.

Suspended users can be found https://govuk.zendesk.com/agent/user_filters

Testing

Tested in integration using Support app

attr = {
  :subject=>"Testing support api",
  "tags"=>["govt_form", "technical_fault", "fault_with_content_data", "govuk_platform_support", "slack_has_been_notified"],
"descreption"=>Testing. Assign to Aga Dufrat (2nd line — GOV.UK Alerts and Issues)"},
requester: { "email" => "<PPI-REDACTED>", "name" => "Some suspended user" }}

Services.support_api.raise_support_ticket(attr)


>  URL: http://support-api/support-tickets (GdsApi::HTTPUnprocessableEntity)
> Response body:
 . {"status":"error","errors":{"requester":["is suspended in Zendesk"]}}

Issue: alphagov/support#1422


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

Follow these steps if you are doing a Rails upgrade.

It's not possible to create Zendesk ticket if a requester is suspended in
Zendesk. The following error is raised:
  ZendeskAPI::Error::RecordInvalid:
  {"requester"=>[{"description"=>"Requester: <Name> is suspended."}]}
  (ZendeskAPI::Error::RecordInvalid)

We don't want to rescue ZendeskAPI::Error::RecordInvalid as this error is
raised for other issue such as incorrect formatting.

Suspended users can be found https://govuk.zendesk.com/agent/user_filters
@AgaDufrat AgaDufrat merged commit 32e0fdb into main Aug 8, 2024
10 checks passed
@AgaDufrat AgaDufrat deleted the suspended-user-check branch August 8, 2024 15:55
@AgaDufrat AgaDufrat self-assigned this Aug 12, 2024
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