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?
Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.
Get Certified! ✍️Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.