Unable to query Jira GraphQL: Argument 'id' annotated with @ARI did not contain valid ARI

Nick de Palézieux March 28, 2023

Hi

I'm trying to use the Jira GraphQL (https://developer.atlassian.com/platform/atlassian-graphql-api/graphql) but I'm failing to make a successful query with the GraphQL gateway (https://api.atlassian.com/graphql#).

To start, I'm just trying to query a Jira issue. By using the query explorer, I got the following query:

query MyQuery {
jira {
issue(id: "17923") {
key
}
}
}

17923 is the issue ID that I found in the `id` field of https://my-domain.atlassian.net/rest/api/3/issue/SOME-ISSUE-KEY-123

 

When I run the query, I get the following error message:

{
"errors": [
{
"message": "Argument 'id' annotated with @ARI did not contain valid ARI: 17923",
"locations": [],
"extensions": {
"classification": "InvalidARI",
"errorSource": "GRAPHQL_GATEWAY"
}
}
],
"data": {
"jira": null
},
"extensions": {
"gateway": {
"request_id": "9c24226e24cd37ec",
"crossRegion": false,
"edgeCrossRegion": false,
"deprecatedFieldsUsed": []
}
}
}

 

I also tried `issue(id: 17923)` (without quotes), then I get

Argument 'id' annotated with @ARI must be a StringValue but is a 'IntValue'

even though the documentation seems to indicate that the id can either be a string or an int.

Is the issue ID found through the REST API not what I need to put in there?

What am I doing wrong?

 

Thanks for your help!

1 answer

0 votes
Morgan DUBUISSON April 18, 2023

Good evening, here is another method that can meet your need

query hostNames {
     tenantContexts(hostNames:["my-domain.atlassian.net"]) {
      cloudId
      }
}
query issuekey{
    jira {
        issueByKey(cloudId:"XXXXX" , key: "DEM-14") {
        id
       }
     }
}

Use First response query for second query

And use : my-domain.atlassian.net/gateway/api/graphql#

 

Good night

KrishnaMohan June 15, 2023

Thank you for the solution.

When I tried the Jira version, I got the same error. It required id mandatory.

I tried with project id, cloud id and version id. No luck

Suggest an answer

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

Atlassian Community Events