Skip to content

Conversation

@Aqil-Ahmad
Copy link
Contributor

What does this PR do?

Adds Zendesk integration for retrieving user support tickets in the Open Self Service platform.

Fixes

#228
/claim #228

Key Changes

  • Implement ZendeskTicketService extending Tickets.Service with getTicket and getTicketList methods
  • Filter tickets by logged-in user email using Zendesk Search API
  • Map Zendesk data model to normalized Tickets model with proper status/priority mapping
  • Make HttpModule global to support dynamic module registration
  • Fix mocked Users service to consistently return jane@example.com for testing
  • Add documentation in apps/docs/docs/integrations/tickets/zendesk.md
  • createTicket not implemented per requirements (returns NotImplementedException)

How to test

  1. Add Zendesk credentials to apps/api-harmonization/.env.local:

Media (Loom or gif)

image

@opirebot
Copy link

opirebot bot commented Oct 30, 2025

👀 We've notified the reward creators here.
Make sure your payment account is ready to receive the payment for your hard work 💪

@Aqil-Ahmad Aqil-Ahmad force-pushed the feat/zendesk branch 2 times, most recently from ff0624a to 1f4d26f Compare October 30, 2025 18:04
@Aqil-Ahmad
Copy link
Contributor Author

not ready for review yet. will work on it tomorrow

}

private fetchTicket(id: string): Observable<ZendeskTicket> {
return this.httpService
Copy link
Collaborator

Choose a reason for hiding this comment

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

please see if any of the JS clients can be used instead fetching manually, it would be probably safer and easier to use https://developer.zendesk.com/documentation/ticketing/api-clients/nodejs/
https://blakmatrix.github.io/node-zendesk/ looks supported, and there is also a types package https://www.npmjs.com/package/@types/node-zendesk/v/2.0.11

Copy link
Contributor Author

@Aqil-Ahmad Aqil-Ahmad Oct 31, 2025

Choose a reason for hiding this comment

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

@marcinkrasowski i investigated using the node-zendesk client library as recommended but discovered some issues
during testing, the client caused backend crashes with TypeError: "callback is not a function" errors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I took a quick look and managed to get it working, but apparently it doesn't support per_page pagination, and I couldn't find any workarounds :( so let's avoid that library.

But I see that there is OpenAPI spec available https://support.zendesk.com/hc/en-us/community/posts/4408861024794-Zendesk-OpenAPI that we could use to generate data model and even TS methods to fetch data. I would ask you to try connecting with Zendesk this way - I'd like to avoid reflecting Zendesk data model in our app.

For generating model that way, I'd recommend openapi-ts that I've used before, but you can also use another tool that you like. The requirements would be:

  1. OpenAPI spec can be stored within the repo itself, but creating a script that fetches it from https://developer.zendesk.com/zendesk/oas.yaml would be even better (this spec could then be added to gitignore)
  2. There should be an prepare script that generates the model & methods, and the generated folder is preferably also added to gitignore
  3. The generated methods and model are used directly inside zendesk.service

For some similarities, you can look up how we generate methods & types for strapi-cms integration (though different tools are used there as it relies on GraphQL schema instead of OpenAPI spec).

If for some reason generatin/using this OpenAPI spec turns out to be impossible, you can at the very least still install node-zendesk library but only use the data models, e.g.

import { Ticket } from 'node-zendesk/clients/core/tickets';

that could replace your ZendeskTicket - but you'd have to see of course if the types really match with the response from Zendesk.,

@marcinkrasowski
Copy link
Collaborator

marcinkrasowski commented Oct 31, 2025

@Aqil-Ahmad which tool are you using to generate code, is it Cursor? I'd like to ask you to provide a feedback about working with AI in our project as well - how easy/difficult was it, did you use any specific prompts (did you simply start with providing the whole issue description?), in which aspects the AI struggled and how much manual fixing was necessary. Also, are you using any additional setup, like Cursor rules or something like that?

We'd like to prepare our repo so that working with AI is as easy as possible, and any feedback is very valuable for us.

@marcinkrasowski
Copy link
Collaborator

@Aqil-Ahmad and one more thing, if you can, please make separate commits when implementing changes that come from code review - it makes it much easier for me to verify them, and we squash commits anyway when merging the PR, so it doesn't really affect commit history.

@Aqil-Ahmad
Copy link
Contributor Author

Aqil-Ahmad commented Oct 31, 2025

@Aqil-Ahmad which tool are you using to generate code, is it Cursor? I'd like to ask you to provide a feedback about working with AI in our project as well - how easy/difficult was it, did you use any specific prompts (did you simply start with providing the whole issue description?), which aspects the AI struggled with and how much manual fixing was necessary. Also, are you using any additional setup, like Cursor rules or something like that? We'd like to prepare our repo so that working with AI is as easy as possible, and any feedback is very valuable for us.

@marcinkrasowski i mostly use gitHub copilot, mainly for generating .md files and consistent comments, resolving errors i can’t fix myself, and occasionally for some parts of the code. i’ll include detailed feedback in the PR description, i know that. i’m also aware of the current issues and conflicts, which is why i mentioned that it’s not ready for review yet.

@Aqil-Ahmad
Copy link
Contributor Author

@Aqil-Ahmad and one more thing, if you can, please make separate commits when implementing changes that come from code review - it makes it much easier for me to verify them, and we squash commits anyway when merging the PR, so it doesn't really affect commit history.

i forgot to update my branch with main, some files from the closed issue got committed by mistake even though i had checked the status before committing. i'll make sure to create separate commits for each change next time

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