-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add Zendesk ticket integration #319
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
base: main
Are you sure you want to change the base?
Conversation
|
👀 We've notified the reward creators here. |
ff0624a to
1f4d26f
Compare
|
not ready for review yet. will work on it tomorrow |
| } | ||
|
|
||
| private fetchTicket(id: string): Observable<ZendeskTicket> { | ||
| return this.httpService |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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:
- 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)
- There should be an
preparescript that generates the model & methods, and the generated folder is preferably also added to gitignore - 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.,
|
@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. |
|
@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. |
@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. |
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 |
1f4d26f to
3aaa24f
Compare
3aaa24f to
b48e6b0
Compare
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
ZendeskTicketServiceextendingTickets.ServicewithgetTicketandgetTicketListmethodsHttpModuleglobal to support dynamic module registrationapps/docs/docs/integrations/tickets/zendesk.mdcreateTicketnot implemented per requirements (returns NotImplementedException)How to test
apps/api-harmonization/.env.local:Media (Loom or gif)