Giter VIP home page Giter VIP logo

Comments (2)

facetoe avatar facetoe commented on August 19, 2024

I know the documentation definitely needs work! I hope to get some more done soon.

You can set the tags and description when creating the ticket by passing them as parameters when creating the Ticket object:

ticket = Ticket(subject='test', description='testing', tags=['sometag', 'anothertag'])

Unfortunately my test Zendesk account has expired so I can't test this, however I believe you can poll the JobStatus object to retrieve the ticket ID's as they are created. For example (untested and ugly code):

tickets_created = 10
ticket_ids = []
job_status = zenpy.tickets.create([Ticket(subject="Ticket%s" % i, description="Bulk")for i in range(0, tickets_created)])
loop = True
while loop:
    for status in job_status.results:
        if status.index == tickets_created -1:
            loop = False
            break
        if status.success:
            ticket_ids.append(status.id)
        else:
            print status.details

    sleep(1)
    if loop:
        job_status = zenpy.job_status(id=job_status.id)

for ticket in zenpy.tickets(ids=ticket_ids):
    # Do things with tickets here

Unfortunately Zendesk doesn't return a complete object when using bulk creation, which would make things a little easier.

Also, you might want to pull the latest version as I've fixed a small bug with the Status object.

Let me know if you have any trouble!

from zenpy.

Black-Milk avatar Black-Milk commented on August 19, 2024

Thank you!

from zenpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.