annapurna Frequent Contributor.
Frequent Contributor.
511 views

How to get audit logs for all defects using rest api

Jump to solution

Dear Members,

How to get audit logs for all defects using rest api . I am getting audit logs for specific id and multiple ids . but I want audit logs for all defects. 

<p>/qcbin/rest/domains/{domain}/projects/{project}/audits?query={parent-type[test];parent-id[101 or 102 or 103]}&amp;order-by={time[asc]} &amp;{user[alex_alm]}.</p> (project level for multiple id)

<p>/qcbin/rest/domains/{domain}/projects/{project}/{entity collection}/{ID}/audits (entity level)

But my requirement is audit logs for all defects. Please help me out . 

 

Thank you 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: How to get audit logs for all defects using rest api

Jump to solution

Why not pull a list of defects then iterate through each ID?

0 Likes
5 Replies
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: How to get audit logs for all defects using rest api

Jump to solution

Regarding your request, the customization that you want to apply needs and specialized assistance, at this moment our team it is working on break and fix and this advanced customization it is out of our scope, for that I am going to send you the information of our Professional services team specialized in workflow code and customizations.

This team is in charge of some activities that are beyond the standard support contract which causes over-delivery:

1- Step-by-step installation (hand holding).

2- Deployment services.

3- Custom code creation/SQL Statements.

4- Training or Educational Services.

https://softwaresupport.softwaregrp.com/km/KM188446

0 Likes
Highlighted
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: How to get audit logs for all defects using rest api

Jump to solution

Why not pull a list of defects then iterate through each ID?

0 Likes
annapurna Frequent Contributor.
Frequent Contributor.

Re: How to get audit logs for all defects using rest api

Jump to solution

Thank you so much ... Yes I have done like that only . I thought might be some other service which will get audit logs of all defects. I am new to ALM

0 Likes
NEW_ALM12 Outstanding Contributor.
Outstanding Contributor.

Re: How to get audit logs for all defects using rest api

Jump to solution

You should be able to find the OTA script here in the forum. Try searching it. Let me know how it goes.

Defect_Audit_log.PNG

0 Likes
Honored Contributor.. arichtman Honored Contributor..
Honored Contributor..

Re: How to get audit logs for all defects using rest api

Jump to solution

To follow up...

 

$alm_uri = "http://alm/qcbin"
$uri = "$alm_uri/api/authentication/sign-in"

#region auth headers
$User_Pass  = $username + “:” + $password
$bytes= [System.Text.Encoding]::UTF8.GetBytes($User_Pass)
$encoded_login=[Convert]::ToBase64String($bytes)
$Auth_Header = "Basic " + $encoded_login
$headers = @{}
$headers.Add("Authorization",$Auth_Header)
#endregion


Invoke-RestMethod -Method Post -Uri $uri -Headers $headers -SessionVariable web_session

$uri = "$alm_uri/rest/domains/public/projects/training/defects"

$Response = Invoke-RestMethod -Method Get -Uri $uri -WebSession $web_session

$Defect_IDs = $Response.Entities.Entity.Fields | select-object -ExpandProperty field | ?{$_.Name -eq 'id'} | %{$_.Value}

$All_Audits = @{}
Foreach($Defect_ID in $Defect_IDs){
$uri = "$alm_uri/rest/domains/public/projects/training/defects/$Defect_ID/audits"
$Response = Invoke-RestMethod -Method Get -Uri $uri -WebSession $web_session
$All_Audits.Add($Defect_ID, $response.Audits.Audit)
}

Write-host $All_Audits["1"]
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.