Example GraphQL queries for Vera data export
The Query and export Vera data includes ready-to-use example queries for common compliance and reporting scenarios. Copy a query as a starting point, then customize the filters and fields for your Vera instance.
Before you start
Before you run the queries in this topic, ensure the following:
-
The GraphQL Console is enabled for your deployment. To enable it, check out Enable the GraphQL Console.
-
You're signed in as a system administrator.
-
You're using real release names, record IDs, and status values from your Vera instance, not the placeholders.
Query tips
Keep the following in mind as you adapt these queries:
|
Tip |
Details |
|---|---|
|
Query names |
Add a name after the query keyword, for example |
|
Field aliases |
Rename output fields with |
|
Filter logic |
Top-level arguments combine with AND. For OR logic, use |
|
Record scope |
The releaseId, releaseName, domainId, and domainName arguments scope the result set. When you pass recordIds, Vera ignores the other record filters. |
Domains and user access
Export domain ownership, user roles, and access details with the following queries:
Domains report
Export domain ownership, linked projects, and users with roles:
query DomainsReport {
domains {
id
name
description
isDefault
owner {
fullName
userId
userName
}
projects {
connectionId
locationId
projectId
}
usersWithRoles {
fullName
roles
userId
userName
}
}
}
User domains and roles
Export users with time zone, status, and domain role assignments:
query UserDomainsAndRoles {
users {
active
email
emailNotificationsEnabled
failedLogins
fullName
id
lastSuccessfulLogin
locked
lockedTime
status
systemRoles
timezone
userName
domains {
domainId
domainName
domainRoles
}
}
}
Approval history and compliance
Export approval history and surface compliance gaps with the following queries:
Approval history of completed routes
Export routes within a certain date range with approver details. This replaces manual MongoDB aggregations for approval-history exports:
query ApprovalHistory2026 {
routes(where: { and: [
{ status: { eq: "Complete" } }
{ stopDate: { contains: "2026" } }
]}) {
recordSnapshot {
syncId
name
recordTypeName
}
domains {
name
}
taskGroups {
tasks {
group
assignee
fullName
timeStamp
}
}
}
}
Non-compliant records
Export records marked Approved in Vera while an approval route is still In Progress:
query NonCompliantRecords {
routes(
routeStatuses: ["In Progress"]
recordStatuses: ["Approved"]
) {
recordSnapshot {
syncId
name
recordTypeName
status
revision
}
id
name
status
}
}
Records, signatures, and releases
Export records, their approval signatures, and release contents with the following queries:
Approved records in a release
Export the approved records in a release, with their approval signatures:
query ApprovedRecordsInRelease {
records(
releaseName: "My Release Name"
where: {
status: { eq: "Approved" }
}
) {
syncId
name
status
revisions {
revision
route {
taskGroups {
name
status
tasks {
userName
fullName
meaning
status
timeStamp
}
}
}
}
}
}
Approved requirement specifications with signatures
Export the approved requirement records in a release, with their approval signatures:
query ApprovedReqSpecForRelease {
records(
releaseName: "My Release Name"
where: {
status: { eq: "Approved" }
recordTypeName: { contains: "Requirement" }
}
) {
syncId
name
status
revisions {
revision
route {
taskGroups {
name
status
tasks {
userName
fullName
meaning
status
timeStamp
}
}
}
}
}
}
Test detail report
Export test runs whose status is routing for approval or approved:
query TestDetailReport {
records(
releaseName: "My Release Name"
where: {
status: { in: ["Routing for Approval", "Approved"] }
recordTypeName: { eq: "qTest Test Run" }
}
) {
syncId
name
status
revisions {
revision
route {
taskGroups {
name
status
tasks {
userName
fullName
meaning
status
timeStamp
}
}
}
}
}
}
Record revisions
Export the full revision history of one or more records with the following queries:
All revisions for selected records
First, query for the record IDs:
query ApprovedRecordIds {
records(where: { status: { eq: "Approved" } }) {
name
syncId
}
}
Then, pass those IDs to recordRevisions:
query RecordRevisionExport {
recordRevisions(
recordIds: [
"1f7bfa2c-1fe8-4c73-92fe-8b343420c4a3"
"a6079f7d-7299-43b8-b75c-5611b0f4625c"
]
) {
recordAtRevision {
fields
id
name
revision
status
}
route {
id
routeTypeName
status
startDate
stopDate
taskGroups {
name
status
tasks {
assignee
fullName
group
id
lastVerified
meaning
rejectionId
signatureId
status
timeStamp
userName
verificationStatus
}
}
}
}
}
Attachments
Export download links for the files attached to a record and to its linked sub-records:
query RecordAttachments {
records(recordIds: "54770384-043f-473a-a095-0d6b55952a5e") {
name
attachments {
contentHash
contentType
fileSize
name
url
attachmentId
}
linkedRecords {
name
records {
name
attachments {
attachmentId
contentHash
contentType
fileSize
name
url
}
}
}
}
}
To download a file, open its url in a browser tab while you're signed in to Vera.