Recent searches


No recent searches

Issue with Ticket Creation using iOS SDK & setting JSON properties

Answered


Posted Aug 02, 2022

We are using the iOS SDK to allow our users to create tickets in zendesk with the click of a button. We do not want them to fill out a webform or use chat - rather, click a button and an automatic ticket with the correct properties should be created in Zendesk Support. 

We're all set up, but we seem to be unable to set the JSON properties brand_id and group_id at ticket creation. We only appear to be able to set subject, tags, description, attachments, custom fields, ticket Form ID

consistent with this article we tried setting using the below code but it is failing: 

var client = ZAFClient.init();
client.set('ticket.group_id', 'groupid');

is it simply not possible to set these types of properties using ZDKRequestProvider and ZDKCreateRequest ? are we missing something? why would it be possible to set custom fields and ticket form but not systemic properties?


0

3

3 comments

image avatar

Greg Katechis

Zendesk Developer Advocacy

Hi Montana! The article that you referenced there is for the Zendesk Apps Framework, not for our mobile SDKs. The documentation that you want would be here, however you are correct that those methods are not available in the SDK. I'll give you some workarounds for these scenarios:

  • For brands, you would need to set the url on initialization of the appropriate subdomain/brand. We mention that in our documentation here, but there are some limitations. One, you would need to initialize the app with the new brand, so the users would lose access to their tickets in the other brand. Two, if you are using JWT, you can just reinitialize the other brand and they could see the tickets there, but if you are using anonymous auth, initializing in the other brand will remove their conversation history in the app. We also don't technically support this workflow, but it is doable. 
  • For groups, you wouldn't be able to set this from requests, since those are based on APIs that are available to end users and end users can not access any of the group APIs. The best way to handle this would be a trigger and you could make it more robust by adding a tag on the request that is specific to the groups that you want to route to. Then in the trigger conditions, use that tag as the condition for routing and you'll be all set.

Let us know if you have any questions about this!

0


Greg Katechis

Thanks for the response! I've gone ahead and used triggers to get the properties set up as a workaround, and i appreciate this explanation for setting the brand. 

another question - and, this seems far-fetched, but this is an odd use-case we're using SDK for. is there any way to set the first comment/description to be private rather than public when creating the ticket through the SDK in this way? 

I should note - we realize that the exact thing we're trying to achieve is far more possible and clear to execute using the gen API to create tickets, we're just currently unable to utilize API resources for the project, but are able to utilize SDK, so i'm trying to hack some of the things i know we can do thru the API with the SDK wherever possible.

0


image avatar

Greg Katechis

Zendesk Developer Advocacy

Unfortunately, that would also not be possible. It goes to the same reasoning that you can't set a group ID...since this is using an anonymous/end user set of APIs/controllers, they wouldn't have access to set the comment as public/private. 

If you can share a bit more of your use-case and/or limitations using our APIs, I may be able to come up with some other hacky solutions for you!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post