Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

REST API Asset AQL search and update

Daniel Wright October 4, 2025

Hello,

I've finding myself going in loops trying to use Google App Script with the JIRA Rest API.

I want to search for an JIRA asset, to confirm that is if found, if it is update it with a new value. Problem is I just can't seem to search for it successfully. Repeatedly getting a 404 response.

I even tried my luck with Google Gemini, and that hasn't help me either.

If you can give me a nudge in the right direction I'd be really grateful, including to the actual JIRA cloud api documentation 



https://mycomp.atlassian.net/rest/servicedeskapi/assets/workspace/<workspaceid>/v1/aql/objects?aql=objectTypeId%3D136%20AND%20Name%3D'ABC'"

const JIRA_AUTH_HEADER = `Basic ${Utilities.base64Encode(JIRA_USERNAME + ':' + JIRA_API_TOKEN)}`;
 const options = {

 method: 'GET',

 headers: {

  Authorization: JIRA_AUTH_HEADER

 },

 muteHttpExceptions: true

};

 

 

1 answer

0 votes
Kai Krause
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2025

Hi,

i use in most cases this https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post 

From the documentation 


# This code sample uses the 'requests' library: 
# http://docs.python-requests.org

import requests
import json url = "https://api.atlassian.com/ex/jira/{cloudId}/jsm/assets/workspace/{workspaceId}/v1/object/aql"

headers
= { "Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer <access_token>" }

query
= { 'startAt': '{startAt}', 'maxResults': '{maxResults}', 'includeAttributes': '{includeAttributes}' }

payload
= json.dumps( { "qlQuery": "objectType = Office AND Name LIKE SYD" } )

response
= requests.request( "POST",

url
, data=payload,
headers
=headers,
params=query ) print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))


In your code - you set the workspaceId ? 
https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-assets/#api-rest-servicedeskapi-assets-workspace-get

BR
Kai 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events