View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Supportez nous sur Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - Get 'history' info using API - ProjeQtOr

Prochaines Sessions

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)
 

13 mai 2025 (10h30-12h)

5 juin 2025 (16h-17h30)

 
 

Planifiez avec ProjeQtOr

14 et 15 mai 2025 (9h-12h30)

18 et 19 juin 2025 (9h-12h30)

 
 

Administrez avec ProjeQtOr

20 et 21 mai (9h-12h30)

25 et 26 juin (9h-12h30)

 

 

 

Get 'history' info using API

More
19 Juil 2016 15:56 #1 by caccia
Hello,

For the purpose of automatically generating KPIs on tickets, I would like to extract date/time information on all the different status changes of a ticket.
For the 'major' transitions (creation / handled / done / closed) everything is available in the ticket itself, but I'm not able to retrieve the time of other transitions between states (done -> validated, for example, or any others which don't set a flag).

Would it be possible to get data from a ticket's history using the API ? (all this info is present in the detailed history of the ticket).

Regards.

Please Connexion or Create an account to join the conversation.

More
20 Juil 2016 00:03 #2 by babynus
You can request API upon object History.
criteria will be :
refType='Ticket'
refId=id of ticket
colName='idStatus'

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
21 Juil 2016 13:19 #3 by caccia
Replied by caccia on topic Get 'history' info using API
Thanks, I guess indeed my request syntax was wrong !

I do still have one issue - may very well be a problem at my side, but I want to be sure:
I use as an example: .../api/History/search/refType = "Ticket"/refId = 10146/colName = "idStatus"

==> I use the Chrome extension "Advanced REST Client" for quick tests, and when encoding this string (UrlEncode) I get the following request string:
GET /api/History/search/refType%3D+%22Ticket%22/refId+%3D+10146/colName+%3D+%22idStatus%22

However on the server side, this leads to a syntax error on the MySQL side:
syntax to use near '"Ticket" and refId = 10146 and colName = "idStatus"

If I change the following line in /api/index.php, I do get expected results.
        } else if (count($split)>=2 and $split[1]=='search') { // =============== uri = {OblectClass}/search
...
//                      $where.=urldecode($split[$cpt]);                        //// this line replaced with below line
                        $where.=html_entity_decode($split[$cpt]);
...
        }
However I haven't figured out if "regular usage" of the API (through PHP code) works fine with the current API code.
I do get the same results when simply pasting the request into Chrome address bar.

So not sure if this is an issue, but I thought I'd mention it - worth a check :)

Please Connexion or Create an account to join the conversation.

More
21 Juil 2016 16:08 - 21 Juil 2016 16:08 #4 by babynus
Just remove the quotes and spaces
.../api/History/search/refType=Ticket/refId=10146/colName=idStatus

Babynus
Administrator of ProjeQtOr web site
Last edit: 21 Juil 2016 16:08 by babynus.

Please Connexion or Create an account to join the conversation.

More
21 Juil 2016 16:47 #5 by caccia
Replied by caccia on topic Get 'history' info using API
Hmm, that is how I started initially :
.../api/History/search/refType=Ticket/refId=10146/colName=idStatus
=> gets me :
***** ERROR ***** Exception-[42S22] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Ticket' in 'where clause'
***** ERROR ***** For query : select * from history where refType=Ticket and refId=10146 and colName=idStatus and (1=1)

and if I try to add quotes (for the MySQL part):
.../api/History/search/refType='Ticket'/refId=10146/colName=idStatus
or .../api/History/search/refType=%27Ticket%27/refId=10146/colName=idStatus
=> gets me:
***** ERROR ***** Exception-[42000] SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
***** ERROR ***** For query : select * from history where refType='Ticket' and refId=10146 and colName=idStatus and (1=1)

Are you able to return expected values with such requests ?

Please Connexion or Create an account to join the conversation.

More
23 Juil 2016 13:16 - 23 Juil 2016 13:17 #6 by babynus
Hi,

This is an issue introduced by security patch on V5.3.
Fix is to replace line 83 in /api/index.php from
$uri=htmlEncode($_REQUEST['uri']);
to
$uri=$_REQUEST['uri'];

Fix will be deployed in coming patch V5.4.4

Babynus
Administrator of ProjeQtOr web site
Last edit: 23 Juil 2016 13:17 by babynus.

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.053 seconds

Paramétrages de cookies

×

Cookies fonctionnels

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Veuillez vous connecter pour voir vos activités!

Autres cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.