Skip to content

Bridging Worlds: Calling Jira’s GraphQL APIs with n8n


Jira has long been the backbone of project tracking and agile workflows, and automation platforms like n8n have become indispensable for connecting Jira with the rest of the toolchain. Traditionally, Jira integrations in n8n have leaned heavily on REST APIs for core functions like creating, updating, or searching for issues via JQL.

However, Atlassian has also been building out a GraphQL gateway that offers a more flexible way to query certain platform data. While its coverage is still limited compared to the REST API, it can be particularly useful for cross-product data (for example, Atlassian Teams or certain Jira Service Management Assets). For anyone building robust automations in n8n, understanding how to combine the power of REST and the efficiency of GraphQL is key to future-proofing your workflows.


Setting up GraphQL with n8n

To successfully query Atlassian’s GraphQL endpoint from an n8n workflow, you need to handle the authentication and structure the request correctly.

1. Authentication via OAuth2 (3LO)

The Atlassian GraphQL gateway requires OAuth 2.0 (3-Legged-OAuth, or 3LO) for authentication. Remember you can also use Jira’s Basic Authentication (Username + API Token) for quick setup in n8n, though OAuth2 is best practice for production apps.

  • Atlassian Developer Console: First, you must register an app in the Atlassian developer console and configure OAuth 2.0 (3LO). Crucially, you must add the appropriate scopes relevant to the GraphQL fields you intend to query (or example,, read:jira-user, read:team, read:assets).
  • n8n Credential: In your n8n instance, create an OAuth2 API credential using the client ID, client secret, and redirect URL from your Atlassian app.
    • Auth URL: https://auth.atlassian.com/authorize
    • Token URL: https://auth.atlassian.com/oauth/token
    • Scopes: A space-separated list of your chosen scopes.

2. Building the GraphQL Request

You can use either the dedicated GraphQL node or a standard HTTP Request node in n8n.

  • Endpoint: The standard Atlassian GraphQL endpoint is https://api.atlassian.com/graphql. (Note: Some specific Forge or tenanted product calls might use a different endpoint, such as https://{your-subdomain}.atlassian.net/gateway/api/graphql).
  • Method: Set the request method to POST. For all GraphQL requests, even simple data fetching (Queries), you must use the HTTP POST method. This is because GET requests cannot contain a body/payload, and CDNs like CloudFront are configured to block the payload-carrying GETs required by most GraphQL implementations, preventing your query from ever reaching the server.
  • Headers: The n8n OAuth2 credential will automatically inject the Authorization: Bearer {{$json["access_token"]}} header.

The body of the request contains the GraphQL query and any variables:

GraphQL Query (to fetch Atlassian Teams)Variables
query ListTeams($first: Int!, $after: String) { teams { search(first: $first, after: $after) { pageInfo { endCursor hasNextPage } nodes { id name description } } } }{ "first": 50, "after": null }

Pagination: The search results from GraphQL often include a pageInfo object with an endCursor and a hasNextPage boolean. You can easily loop through the results in n8n using an IF node and updating the after variable until hasNextPage is false.

3. Testing in the GraphQL Explorer

Before wiring up a complex n8n workflow, always use the Atlassian GraphQL Explorer. This browser-based tool allows you to validate your queries and confirm which fields are available to your app’s scopes, saving significant debugging time.


When to Use REST vs. GraphQL in Jira Automations

GraphQL is not a full replacement for Jira’s comprehensive REST API; rather, it’s a powerful companion.

API StylePrimary Use Case
REST APICRUD operations for issues, projects, sprints, workflows, and complex JQL searches. This is the majority use case for core Jira data.
GraphQL APIFetching cross-product platform data, such as Atlassian Teams metadata, certain JSM Assets, or data that spans multiple Atlassian products.

In practice, most sophisticated n8n automations will become hybrid workflows. You might use GraphQL to efficiently fetch team or asset metadata, and then use a REST call (via the built-in Jira Software node or an HTTP Request node) to retrieve and update the specific Jira issues associated with those entities.


Example Hybrid Workflow in n8n

A common scenario is generating a weekly report that groups Jira issues by the assigned Atlassian Team:

  1. Trigger: A Cron node runs hourly or daily.
  2. GraphQL node: Fetches the full list of Atlassian Teams using the query structure above.
  3. Split In Batches node: Processes the list of teams one by one.
  4. Jira Software node / HTTP Request: For each team, queries related Jira issues using the team’s ID within a JQL query (a REST API call).
  5. Merge node: Combines the rich team metadata (from GraphQL) with the specific issue data (from REST).
  6. Sink: The final data is written to a database, used to generate a report in Google Sheets, or sent as a notification to Slack.

This hybrid approach ensures you get the best of both worlds: the targeted efficiency of GraphQL where supported, and the complete coverage of REST for core Jira operations.


Other Jira–n8n Use Cases (Beyond APIs)

Beyond direct API calls, n8n is an indispensable tool for extending Jira’s functionality:

  • Automatic Ticket Creation: Create Jira tickets directly from emails, Slack messages, or Typeform submissions.
  • Data Enrichment: Enrich Jira issues with customer data from CRM systems (like Salesforce or HubSpot) or CI/CD pipeline status.
  • Incident Management: Trigger incident tickets in Jira Service Management when a monitoring alert (or example,, from Datadog or Prometheus) fires.
  • Dev Workflow Sync: Keep Jira synchronized with tools like Confluence, GitHub, or Notion for a seamless development process.

Conclusion

While Jira’s GraphQL APIs are not yet a full replacement for REST, they open the door to more targeted and efficient queries, especially for Atlassian Teams and certain Assets data. With n8n, you can seamlessly integrate these GraphQL calls into automated workflows, often combining them with the robust REST endpoints to cover the full spectrum of Jira use cases.

If you’re building automation around Jira, experiment with GraphQL where possible to leverage its efficiency, but keep REST in your back pocket. Together, they give you a flexible, future-proof approach to Jira integrations in n8n.

You may find this video on how to connect Jira to n8n useful for getting started with the Jira Software node:

Click here to display content from YouTube.
Learn more in YouTube’s privacy policy (opens in a new tab).