Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,360,942
Community Members
 
Community Events
168
Community Groups

differing GraphQL responses with issueSearchStable

In the browser-based GraphQL explorer for my sub-domain at https://hv-eng.atlassian.net/gateway/api/graphql  I can specify a query:

query getProjectAttachments {
jira {
issueSearchStable(first: 100,
cloudId: "<MY_CLOUD_ID>",
issueSearchInput: { jql: "project = '<MY_PROJECT_KEY>' AND attachments IS NOT EMPTY" } ){
pageInfo {
endCursor
hasNextPage
}
edges {
node {
key
webUrl
attachments{
edges {
node {
attachmentId
fileName
fileSize
}
}
}
}
}
}
}
}

with header request:

{
"X-ExperimentalApi" : "JiraIssueSearch"
}

and get results populated properly

If I try to translate this over to a curl command I get a DecodingException

$ curl -s -X POST \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-ExperimentalApi: JiraIssueSearch' \
--header 'Authorization: Basic <MY_BASE64_ENCODED_EMAIL:API-TOKEN>' \
-d "{ query getProjectAttachments { \
jira { \
issueSearchStable(first: 100, \
cloudId: \"<MY_CLOUD_ID>\", \
issueSearchInput: { jql: \"project = '<MY_PROJECT_KEY>' AND attachments IS NOT EMPTY\" } ) { \
pageInfo { \
endCursor \
hasNextPage \
} \
edges { \
node { \
key \
webUrl \
attachments { \
edges { \
node { \
attachmentId \
fileName \
fileSize \
} \
} \
} \
} \
} \
} \
} \
} \
}" \
"https://hv-eng.atlassian.net/gateway/api/graphql" | jq '.'

{
"timestamp": 1662593267335,
"path": "/central/graphql",
"status": 400,
"error": "Bad Request",
"message": "Failed to read HTTP message",
"requestId": "59a78998-5304466",
"exception": "org.springframework.core.codec.DecodingException",
"request_id": "UNKNOWN",
"query": "unknown",
"operation": "unspecified",
"schema": "unspecified",
"errorSource": "GRAPHQL_GATEWAY"
}

Running this same query in Java it seems to accept it but it returns zero results:

{
"data": {
"jira": {
"issueSearchStable": {
"pageInfo": {
"hasNextPage": false
},
"edges": []
}
}
},
"extensions": {
"gateway": {
"request_id": "5cfe11d3d159581b",
"crossRegion": true,
"edgeCrossRegion": false,
"deprecatedFieldsUsed": []
}
}
}

 

I guess I have a couple issues here.  I don't see anything wrong with my curl query that would cause a DecodingException.  I'm much more concerned about not getting any data in my Java process though, as that's where I intend to do my data processing.  Does the web-based explorer have a broader permission set somehow?

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

5,048 views 18 32
Read article

Atlassian Community Events