Hi All,
I am trying to get the issues details which are linked to the assets, but I am not able to get this in just one simple call.
I am trying to get all assets details through below endpoint:
https://api.atlassian.com/jsm/assets/workspace/{{workspace-id}}/v1/object/navlist/aql
POST data:
{
"objectTypeId": "15",
"page": 1,
"asc": 1,
"resultsPerPage": 2,
"ncludeAttributesDeep": 2,
"includeAttributes": true,
"includeExtendedInfo": true,
"objectSchemaId": "5",
"qlQuery": "name in (xxxxx)"
}
I am getting ids of assets from above response and doing another calls to
GET https://api.atlassian.com/jsm/assets/workspace/{{ workspace-id }}/v1/objectconnectedtickets/{{ asset id }}/tickets
These are many calls to make to get issue details, I don’t want whole issue details, I just need ticket id/key, but these calls gives me requests limit exceeded.
is there anything I can get all assets details in just one call having linked tickets details?
Any help here will be highly appreciated!!!
Thanks!
2 Likes
Hi @AnilJeeyani
Welcome to our developer community.
I have reached out to our team about this. We will get back to this soon. Thanks.
2 Likes
I checked with our team and here is a suggestion:
Instead of using https://api.atlassian.com/jsm/assets/workspace/{{ workspace-id }}/v1/objectconnectedtickets/{id}/tickets
, try /{id}/paginatedtickets
at the end. This should give you paginated results of tickets. Let me know if that helps. Thanks.
1 Like
I just happened to test this with both /tickets and /paginatedtickets APIs, and I was able to get details of all the linked tickets at once. Below is the API call and response:
curl --location --request GET 'https://api.atlassian.com/jsm/assets/workspace/workspace-id/v1/objectconnectedtickets/object-id/tickets' \
--header 'Authorization: Basic token
{
"tickets": [
{
"workspaceId": "...",
"globalId": "...",
"key": "SST-2",
"id": "10005",
"reporter": "5bbd4acea334ec43251974fa",
"created": "2023-10-20T05:41:16.584Z",
"updated": "2023-10-20T05:41:30.271Z",
"title": "another ticket",
"status": {
"name": "Waiting for support",
"description": "",
"colorName": "yellow"
},
"type": {
"name": "Get IT help",
"description": "Lodge a service request if you need help with requesting new hardware/software or access to a system",
"iconUrl": "https://....atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10320?size=medium"
},
"priority": {
"name": "Medium",
"iconUrl": "https://....atlassian.net/images/icons/priorities/medium.svg"
}
},
{
"workspaceId": "7a7c31ea-ac30-4f01-9580-56f8bba540f5",
"globalId": "7a7c31ea-ac30-4f01-9580-56f8bba540f5:10004",
"key": "SST-1",
"id": "10004",
"reporter": "5bbd4acea334ec43251974fa",
"created": "2023-10-20T05:07:15.837Z",
"updated": "2023-10-20T05:27:14.242Z",
"title": "testing",
"status": {
"name": "Waiting for support",
"description": "",
"colorName": "yellow"
},
"type": {
"name": "Get IT help",
"description": "Lodge a service request if you need help with requesting new hardware/software or access to a system",
"iconUrl": "https://....atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10320?size=medium"
},
"priority": {
"name": "Medium",
"iconUrl": "https://anmol3.atlassian.net/images/icons/priorities/medium.svg"
}
}
],
"allTicketsQuery": "id in (10005,10004) and resolution is empty"
}
1 Like
I forgot to make it clear. The above response consists of issue keys under “key”. Here, “SST-1” and “SST-2” are the keys of the linked issues.
1 Like
Thanks @aagrawal2 !
I think my question is not clear yet.
If I have more than 1000 asset ids, I have to call 1000 times your suggested url having /paginatedtickets
If you go to my first post here, you will find /v1/object/navlist/aql
endpoint, where we can pass these asset ids comma separated in qlquery
. This is just one call. If you see that post data here, it has that includeExtendedInfo
, but when we see response, we don’t get associated tickets details.
So, no mater if I use /tickets
or /paginatedtickets
, my concern will remain same. I want to reduce API calls, so if you can give me associated ticket details to /v1/object/navlist/aql
, would be highly appreciated!
1 Like
Ah ok. I didn’t understand that before. Thanks for clarifying. Let me try that out and see if I can replicate it. If so, will try to find a solution. Thanks.
@AnilJeeyani We have found out that currently, there is a gap in APIs. We have raised a feature request for this for now which can be tracked here - https://jira.atlassian.com/browse/JSDCLOUD-13228. We tried looking for a workaround, but unfortunately couldn’t find one which would address the issue of request limit exceeded.
1 Like
@aagrawal2 any update here please
I checked on https://jira.atlassian.com/browse/JSDCLOUD-13228, seems nothing happening there