[rt-users] External authentication and RT's REST API

2016-11-02 Thread Anthony Nguyen-Duong
Hello rt-users,


So, I've implemented a Google Sign In flow into Request Tracker with 
WebRemoteUserAuth enabled and an Apache module called mod_auth_openidc. Now, 
I'd like to access RT's REST API with an account authenticated through the 
external flow. Since these accounts don't have a standard login flow , you 
can't just do REST/1.0/?something=something=USERNAME=PASSWORD right? 
So, I was wondering how to let those kinds of users access the REST API. These 
users don't necessarily have an RT password - eg autocreated.


Thanks,

Anthony
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Los Angeles - Q1 2017

[rt-users] Getting all transactions using RT REST API?

2016-10-14 Thread Anthony Nguyen-Duong
Hi rt-users,


I'm currently working on a web app to pull statistics from RT. One of the stats 
I'd like to show for each ticket is the number of emails received.

The way that I've implemented it now is essentially go to 
/REST/1.0/ticket/nn/history/ and then count up the number of emails. But I call 
this for every single ticket. So it's horribly inefficient for larger number of 
tickets.

I was wondering if there was a way of getting all the transactions in one API 
call instead of one for every ticket I iterate through.


Thanks,

Anthony
-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017

[rt-users] Calculating the number of emails/replies/correspondences per ticket

2016-10-04 Thread Anthony Nguyen-Duong
Hi,


I'd like to find out how to add my own calculation to charts, as opposed to the 
limited Ticket Count and various time calculations available for charts.

I'd like to add a calculation that calculates the number of 
emails/correspondences between an agent and a customer. I've tried looking 
through "lib/RT/Report/Tickets.pm" and "share/html/Search/Chart.html", but 
there's a lot of things I don't understand in there.


Now, realistically I may not have to go through the effort of adding a 
calculation for charts.

My end result is a table that has the columns: TicketId, NumberOfEmails (and 
I'll probably add some other things like Subject and whatnot). However, I'd 
prefer not to have a Custom Field for NumberOfEmails, reason being I'm not sure 
if there's a way to calculate the number of emails for all my past tickets and 
set all of them to their correct value apart from manually counting and 
inputting it. Instead, I was considering doing Callbacks or something to count 
the number of Correspondences in the Transactions table from the database and 
appending a column to a table.


If I instead added a chart calculation, the end result would be more flexible - 
at the cost of a (possibly?)difficult implementation.

> New Chart

> Group tickets by Ticket/Id. (individual tickets, so basically no grouping; 
> this might get out of hand for large numbers of tickets though; this is 
> something else I'd like to know how to do)

> Calculate values of Email count.

> Generate bar chart or table


Now that I think about it though, I might just be able to add a column called 
Number of Emails to search results and get that sorted out.

Sorry my thoughts are kind of all over the place right now.


In summary, envisioned end result:

- A table/search result list (doesn't necessarily have to be a chart) that can 
be added to a dashboard that has, at minimum, the columns: TicketId and 
NumberOfEmails

- NumberOfEmails is preferably not a Custom Field

- The column NumberOfEmails must be able to find the number of emails between 
an agent and customer of all tickets that are currently in my database (I'd 
imagine I have to use SQL for this somewhere to count Correspondences for 
specific TicketId's)


I'd like to know what the best thing to do would be and how to start working on 
a solution.



I hope I've explained my problem well enough.

I can clarify further if you'd like.


Thank you,

Anthony

-
RT 4.4 and RTIR training sessions, and a new workshop day! 
https://bestpractical.com/training
* Boston - October 24-26
* Los Angeles - Q1 2017