Created
June 16, 2023 11:49
-
-
Save richkuz/eaf0dc98434684bff47dd7fa3f49870d to your computer and use it in GitHub Desktop.
Jira GraphQL API Query Issues with links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example Jira GraphQL API to fetch a Cloud ID, query for issues with JQL, and get issues with links, i.e. child issues | |
# | |
# Run this in https://developer.atlassian.com/platform/atlassian-graphql-api/graphql/explorer/ | |
# | |
# In the GraphQL explorer UI, at the bottom, add these Request Headers: | |
# { | |
# "X-ExperimentalApi" : "JiraIssueSearch" | |
# } | |
# | |
query fetchCloudId { | |
tenantContexts(hostNames:["MYCOMPANY.atlassian.net"]) { | |
cloudId | |
} | |
} | |
query issueLinks { | |
jira { | |
issueSearchStable( | |
cloudId: "e98..123", | |
issueSearchInput: { | |
jql: "project = 'XX' and type='Bug' and status not in ('CLOSED') AND issueLinkType is not empty" | |
} | |
) { | |
edges { | |
node { | |
key | |
issueLinks { | |
edges { | |
node { | |
relationName | |
issue { | |
key | |
# No apparent way to get status field _value_ as of 2023-06-16 :-( | |
# fieldsById(ids: ["status"]) { | |
# edges { | |
# cursor | |
# node { | |
# id | |
# fieldId | |
# aliasFieldId | |
# type | |
# description | |
# name | |
# __typename | |
# } | |
# } | |
# } | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment