Highlighted
Absent Member.
Absent Member.
836 views

Querying RunID from Performance center via REST API

Hello,

What will be the best way to get all the runIds for a day or for a specified time via REST API's in PC 12.2  ?

 

Also i am triggering few tests in v12.2 via jenkins, jenkins shows the runIDs in logs but is is possible to read that value and store it  ?

 

Thanks,

Sushant

0 Likes
1 Reply
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Querying RunID from Performance center via REST API

Hi Sushant,

 

You can use the following queries to get the ids for runs based on date/time. All of these are used as a query for the following endpoint on the ALM REST API:

 

http://%HOST%/rest/domains/%DOMAIN%/projects/%PROJECT%/runs

 

-Gets all test run ids where the execution-date is %DATE%

?query={execution-date[=%DATE%]}&fields=id

 

-Gets all test run ids where the execution-date is after %DATE%

?query={execution-date[%3E%DATE%]}&fields=id

 

-Gets all test run ids where the pc-end-time is after %DATE% %TIME%

?query={pc-end-time[%3E%27%DATE%%20%TIME%%27]}&fields=id

 

-Gets all test run ids where the pc-end-date is after %DATEA% %TIMEA% and before %DATEB% %TIMEB%

?query={pc-end-time[%3E%27%DATEA%%20%TIMEA%%27];pc-start-time[%3C%27%DATEB%%20%TIMEB%%27]}&fields=id

 

For each of these:

%3E is the greater than symbol
%3C is the less than symbol
%27 is a single quote
%20 is a space
%DATE% for me is in the format yyyy-MM-dd, e.g. 2013-04-16
%TIME% for me is in the format HH:mm:ss, e.g. 11:00:00

 

Note that when using date+time there needs to be a space between them  and they must be surrounded by single quotes 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.