I'm trying to fetch all Asset IDs from Jira in a single request to perform a FROM/TO mapping for an application, but I'm not able to retrieve them.
Could someone help me with this?
I need the ID shown in print1, and ideally I'd like to get all existing ones at once.
Hello @Hais_ Pedro
What have you tried?
There is an REST API endpoint that can be used to retrieve asset objects based on AQL
https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post
The endpoint allows you to specify the maximum number of results to return, but some REST endpoints cap that maximum so that the hosts cannot be overburdened by a request retrieving too many results. You may have to experiment with increasing the maxResults parameter to see how high you can push it.
i have no idea, what i put in this query:
"qlQuery": "objectType = Office AND Name LIKE SYD"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you reviewed the documentation an AQL (Asset Query Language)?
https://support.atlassian.com/jira-service-management-cloud/docs/use-assets-query-language-aql/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Got it, but do i need any special permission? Should it be done via OAuth 2.0 authentication? I generated keys (OAuth 2.0), but i still getting a "Not Found response.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How are you trying to execute the call?
What is the payload you are providing? Obscure your base URL and token information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The API endpoint you have used is not the one I recommended.
https://developer.atlassian.com/cloud/assets/rest/api-group-object/#api-object-aql-post
The API endpoint you have specified does not appear to be in the documentation. The "Not found" response you are getting is because the endpoint is not found.
Can you provide a link to the documentation you referenced to get that endpoint?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well im try this way with Bearer that i get here:
curl -X POST https://auth.atlassian.com/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "authorization_code",
"client_id": "SEU_CLIENT_ID",
"client_secret": "SEU_CLIENT_SECRET",
"code": "SEU_AUTHORIZATION_CODE",
"redirect_uri": "http://localhost:8000/callback"
}'
But i still get "code": 401,
"message": "Unauthorized"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill when i inspect the page, i found other workspaceID diferent of the one i retrieve here:
https://api.atlassian.com/oauth/token/accessible-resources
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The accessible-resources endpoint provides IDs for Site IDs, as per
https://developer.atlassian.com/cloud/oauth/getting-started/making-calls-to-api/
You need an Asset Workspace ID. Use this API to get the workspace ID to use with Assets APIs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
right, about the Bearer token, we have a way to get a token that don't expires? Or at least belong more time?
Also, its a bit annoying to get the token - having to make two requests an do it every hour, one to get the code and another to get the Bearer itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For the assets API i receive this response: Client must be authenticated to access this resource.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your question about getting a token programmatically is not in line with what seemed to be your original topic - retrieving Jira Asset IDs.
I think you may find that the Developer Community has more knowledge related to development of interfaces to the Atlassian Cloud system. You can find a link to the Developer Community here:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, but i wanna know how even with the managers authorization, i simply get a StatusCode: 401 Client must be authenticated"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
in the API:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Developing an application including properly authenticating the user is outside my experience.
In the Developers Community there are people experienced with that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.