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

Zendesk to replit #52

Merged
merged 8 commits into from
Dec 21, 2023
Merged

Zendesk to replit #52

merged 8 commits into from
Dec 21, 2023

Conversation

ArtsiomWB
Copy link
Contributor

@ArtsiomWB ArtsiomWB commented Dec 5, 2023

Changes:

  • Added zd integration to run.sh
  • Added a new file to the zendesk directory extract_by_type.py which has different question extraction methods depending on what type of ticket it is.
  • Made the tickets to get pulled every 10 minutes
  • Made every ten minutes we relogin to the Zenpy API, because it times out if it has been more than 3 minutes
  • Got the tickets to private answer the Offline Chat messages that come in when chat isn't on after certain hours.

Tested by:

  • Creating multiple dummy tickets in Zendesk with dummy questions, then having the script pull them up, process them and reply to the dummy questions.

  • Was tested with zd tickets with different tags such as forum - which is usually used for discourse tickets and zopim_offline_message - these tickets are sent to us when the chat is down during the night time. Making sure tagging worked was essential to get the script to answer specific tickets - Discourse and Offline Chat Tickets.

  • Tested on different numbers of tickets at the same time, anywhere from 1 to 12 including real free-user tickets and the dummy tickets that would be answered at the same time.

  • After Semaphore was added to limit 5 api calls per minute, tested to make sure the script works with more and less than 5 tickets which are needed to be answered. This was done by create multiple dummy tickets along with the tickets that already have been answered and made the zd script answer those tickets in the count of 5s every minute.

  • Have been running the script in github workspaces without an issue.

Copy link
Member

@morganmcg1 morganmcg1 left a comment

Choose a reason for hiding this comment

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

Response
Screenshot 2023-12-05 at 11 04 25

the response should start with letting the user know that this is an automated reply from our technical support bot and if they are not happy with the response they should contact support@wandb.com (or do something in Discourse, whatever Support Team would like the user to do).

You should also figure out a better way to handle longer responses, its not good if the response is curtailed as the answer might be in the curtailed bit. maybe post as a second comment?

Query timing
Screenshot 2023-12-05 at 11 00 29
When looping through a ticket I'd like to see a limit to the number of async requests being made to the wandbot api so that other users aren't impacted. Maybe somewhere in the region of 5 per minute? You can use asyncio.semaphore to set the max number of async calls:

Screenshot 2023-12-05 at 11 07 37

src/wandbot/apps/zendesk/__main__.py Outdated Show resolved Hide resolved
src/wandbot/apps/zendesk/__main__.py Outdated Show resolved Hide resolved
src/wandbot/apps/zendesk/extract_by_type.py Outdated Show resolved Hide resolved
src/wandbot/apps/zendesk/extract_by_type.py Outdated Show resolved Hide resolved
@morganmcg1
Copy link
Member

Thanks, is #46 still needed or should it be closed?

Copy link
Member

@morganmcg1 morganmcg1 left a comment

Choose a reason for hiding this comment

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

Thanks, 1 comment. Also can you update the description to share how this was tested? thanks!

src/wandbot/apps/zendesk/__main__.py Outdated Show resolved Hide resolved
Copy link
Member

@morganmcg1 morganmcg1 left a comment

Choose a reason for hiding this comment

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

Naming needs be be adjusted, see the style guide here: https://cheatography.com/sunnyphiladelphia/cheat-sheets/google-style-for-python/

src/wandbot/apps/zendesk/__main__.py Outdated Show resolved Hide resolved
@morganmcg1 morganmcg1 merged commit 37d142e into main Dec 21, 2023
4 checks passed
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.

None yet

2 participants