Hello,
My goal is to query Jira Assets (Jira Service Management) for all Objects with a specific ID, return all attributes for those assets, and then later on process the data. But no matter the way I try, I can’t seem to query more than 25 results via AQL POST code.
Below is the snippet of the core functionality.
# === 1. AQL: ONLY schema 2 + SubVenue type ===
AQL="objectSchemaId = ${SCHEMA_ID} AND objectTypeId = ${SUBVENUE_TYPE_ID}"
echo "Running SubVenue debug AQL against Jira Assets:"
echo " $AQL"
echo
start_index=0
per_page=200
total=0
declare -a subvenues=()
while true; do
body=$(jq -n \
--arg q "$AQL" \
--argjson start "$start_index" \
--argjson per "$per_page" \
'{
qlQuery: $q,
includeAttributes: false,
startIndex: $start,
resultPerPage: $per
}')
response=$(curl -s -u "$JIRA_USER:$JIRA_TOKEN" -X POST \
"https://api.atlassian.com/jsm/assets/workspace/$WORKSPACE_ID/v1/object/aql" \
-H "Content-Type: application/json" \
-d "$body")