z4r / python-rtkit

Python Api for Request Tracker's REST interface
http://z4r.github.com/python-rtkit/
Other
68 stars 44 forks source link

How can I see the tickets Assigned to my Group? #43

Open prophaner opened 9 years ago

prophaner commented 9 years ago

In the GUI, I have a way to see 'Tickets Assigned to my groups', then they all have in common the 'AdminCc (group)' header. How can I make this search using the API, if is possible?

z4r commented 9 years ago

Hi @prophaner , the url to call is something like: /REST/1.0/search/ticket?query=AdminCc="YOURGROUP"

So with the library will be:

try:
    response = resource.get(path='search/ticket?query=AdminCc="YOURGROUP"')
    logger.info(response.parsed)
except RTResourceError as e:
    logger.error(e.response.status_int)
    logger.error(e.response.status)
    logger.error(e.response.parsed)

You if need more info about queries: http://requesttracker.wikia.com/wiki/REST

prophaner commented 9 years ago

Thanks for your reply. I was actually trying it that way, no success.

On Fri, Apr 17, 2015 at 1:45 PM, Andrea de Marco notifications@github.com wrote:

Hi @prophaner https://github.com/prophaner , the url to call is something like: /REST/1.0/search/ticket?query=AdminCc="YOURGROUP"

So with the library will be:

try: response = resource.get(path='search/ticket?query=AdminCc="YOURGROUP"') logger.info(response.parsed)except RTResourceError as e: logger.error(e.response.status_int) logger.error(e.response.status) logger.error(e.response.parsed)

You if need more info about queries: http://requesttracker.wikia.com/wiki/REST

— Reply to this email directly or view it on GitHub https://github.com/z4r/python-rtkit/issues/43#issuecomment-94036654.

Regards, Luis M. Ramos Aguilar

prophaner commented 9 years ago

Andrea, I just forked your code, maybe I can contribute.

On Fri, Apr 17, 2015 at 2:13 PM, Luis Ramos lmramos89@gmail.com wrote:

Thanks for your reply. I was actually trying it that way, no success.

On Fri, Apr 17, 2015 at 1:45 PM, Andrea de Marco <notifications@github.com

wrote:

Hi @prophaner https://github.com/prophaner , the url to call is something like: /REST/1.0/search/ticket?query=AdminCc="YOURGROUP"

So with the library will be:

try: response = resource.get(path='search/ticket?query=AdminCc="YOURGROUP"') logger.info(response.parsed)except RTResourceError as e: logger.error(e.response.status_int) logger.error(e.response.status) logger.error(e.response.parsed)

You if need more info about queries: http://requesttracker.wikia.com/wiki/REST

— Reply to this email directly or view it on GitHub https://github.com/z4r/python-rtkit/issues/43#issuecomment-94036654.

Regards, Luis M. Ramos Aguilar

Regards, Luis M. Ramos Aguilar

z4r commented 9 years ago

you are welcome ;) I succest you to start from a working url in the browser ;)

prophaner commented 9 years ago

Andrea, I commited a fix to a few PEP items. I also suggest to replace the name of some arguments as they start with Capital and they should be all lowercase. Like 'Queue'.

On Sat, Apr 18, 2015 at 4:08 AM, Andrea de Marco notifications@github.com wrote:

you are welcome ;)

— Reply to this email directly or view it on GitHub https://github.com/z4r/python-rtkit/issues/43#issuecomment-94142610.

Regards, Luis M. Ramos Aguilar

z4r commented 9 years ago

Make your Pull Request so I can see these suggestions ;)