Our team is setting up our new discourse site and utilizing the zendesk plugin. We’ve gotten the two way sync to work, and everything is smooth.
However, there are some sometimes our members may ask for a password reset, or we may need to share personal information. Is there any way to keep the two way message sync between between disocurse <> zendesk if the topic is moved to a private topic? Or, can anyone think of a workaround that may allow us to answer tickets in private messages?
I encountered the same issue and was able to resolve it by modifying the code logic of the Zendesk Plugin. Here’s the solution:
In the file of the Zendesk Plugin:
app/jobs/regular/zendesk_job.rb
Make the following changes:
def push_topic!(topic_id)
topic = Topic.find_by(id: topic_id)
return unless topic.present?
if DiscourseZendeskPlugin::Helper.autogeneration_category?(topic.category_id)
topic.post_ids.each { |post_id| push_post!(post_id) }
end
end
In the Zendesk Plugin
lib/discourse_zendesk_plugin/helper.rb
def self.autogeneration_category?(category_id)
return true if category_id.nil?
return false if category_id.blank?
if SiteSetting.zendesk_autogenerate_all_categories?
true
else
SiteSetting.zendesk_autogenerate_categories.split("|").include?(category_id.to_s)
end
end
I believe the issue occurs because private category topics do not have a category assigned, which prevents them from syncing with Zendesk based on the current code logic.
To resolve this, I modified the logic to allow topics to be created in Zendesk even if a category is not assigned. I’m not entirely sure if this is the best approach, but it worked for me.
After making these changes, please test it on your end to ensure it resolves the issue for you as well.
For handling sensitive stuff like password resets, you can try moving the topic to a private category only staff can access. The tricky part is that private categories might not sync with Zendesk because of how the plugin works.
@abinash889 solution is spot on! The issue happens because private topics often don’t have a category assigned, so they don’t sync. By tweaking the Zendesk plugin code as they explained, you can make it work by allowing topics without a category to sync.
If you’re okay with editing the plugin, give it a shot and test it out. Otherwise, you could handle these sensitive requests directly in Zendesk.