ocflib icon indicating copy to clipboard operation
ocflib copied to clipboard

Added get newest RT ticket

Open lancemathias opened this issue 4 years ago • 2 comments

New method to get latest RT ticket using REST API. Pushed to master to test since local tests aren't working.

lancemathias avatar Oct 02 '21 23:10 lancemathias

(Closed and reopened, which seems to have fixed CI not getting triggered initially)

emmatyping avatar Oct 03 '21 10:10 emmatyping

https://metacpan.org/pod/RT::Extension::REST2#Cookie-Auth There's some discussion in #rebuild regarding using REST 2.0 api. The issue is for REST 2.0 it appears that the docs suggest against using session-token to authenticate, so every time auth token/password is needed in the header if I understand it correctly? Otherwise use resp = s.get('https://rt.ocf.berkeley.edu/REST/2.0/tickets?query=Queue="help"&orderby=Created&order=DESC', headers={"Authorization": "token dskljvelkajdhvluierwbvlijaebvleisuadghea"}) json parse resp.text, and pick the first in items.

axmmisaka avatar Jan 13 '22 05:01 axmmisaka