Developer
Get Support
Sign in
Get Support
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Sign in
DOCUMENTATION
Cloud
Data Center
Resources
Sign in
Last updated Oct 29, 2025

Project associated repo

The ProjectAssociatedRepo relationship represents the link between a Jira project and an external repository within the Teamwork Graph. It allows you to:

  • Retrieve external repositories associated with a specific Jira project
  • Find which Jira projects are associated with an external repository
  • Traverse and analyze project-repository relationships

Relationship type: Canonical

From object typeTo object type
Jira project - ati:cloud:jira:projectExternal repository - ati:cloud:jira:repository

Cypher

We recommend using parameterized Cypher queries rather than placing parameters directly in the query string. This helps improve performance.

Forward query

GraphQL
1
2
query ProjectAssociatedRepo_CypherQuery($cypherQuery: String!, $params: JSON!) {
 graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
  cypherQueryV2(query: $cypherQuery, params: $params) {
   edges {
    node {
     columns {
      key
      value {. on GraphStoreCypherQueryV2NodeList {
        nodes {
         data {. on DevOpsRepository {
           id
          }. on ExternalRepository {
           id
          }
         }
        }
       }. on GraphStoreCypherQueryV2AriNode {
        data {. on DevOpsRepository {
          id
         }. on ExternalRepository {
          id
         }
        }
       }. on GraphStoreCypherQueryV2BooleanObject {
        bool_val: value
       }. on GraphStoreCypherQueryV2IntObject {
        int_val: value
       }. on GraphStoreCypherQueryV2FloatObject {
        float_val: value
       }. on GraphStoreCypherQueryV2StringObject {
        str_val: value
       }
      }
     }
    }
   }
  }
 }
}
Params
1
2
{
 "cypherQuery": "MATCH (project:JiraProject {ari: $id})-[:project_associated_repo]->(repository:GraphRepository) RETURN repository",
 "params": {
  "id": "$id"
 }
}

Inverse query

GraphQL
1
2
query ProjectAssociatedRepo_CypherQuery($cypherQuery: String!, $params: JSON!) {
 graphStore @optIn(to: ["GraphStore", "GraphStoreCypherQueryV2"]) {
  cypherQueryV2(query: $cypherQuery, params: $params) {
   edges {
    node {
     columns {
      key
      value {. on GraphStoreCypherQueryV2NodeList {
        nodes {
         data {. on JiraProject {
           id
          }
         }
        }
       }. on GraphStoreCypherQueryV2AriNode {
        data {. on JiraProject {
          id
         }
        }
       }. on GraphStoreCypherQueryV2BooleanObject {
        bool_val: value
       }. on GraphStoreCypherQueryV2IntObject {
        int_val: value
       }. on GraphStoreCypherQueryV2FloatObject {
        float_val: value
       }. on GraphStoreCypherQueryV2StringObject {
        str_val: value
       }
      }
     }
    }
   }
  }
 }
}
Params
1
2
{
 "cypherQuery": "MATCH (project:JiraProject)-[:project_associated_repo]->(repository:GraphRepository {ari: $id}) RETURN project",
 "params": {
  "id": "$id"
 }
}

Materialization via Cypher Experimental

This materialization rule automatically creates project_associated_repo relationships by traversing from Jira projects through multiple paths to find associated repositories:

  • Branch path: project → associated branches → repositories containing those branches
  • Commit path: project → issues → associated commits → repositories containing those commits
  • Pull request path: project → associated pull requests → repositories containing those pull requests
  • Explicit path: project → explicitly associated repositories (direct connection)
Cypher
1
2
// Materialization Rule: branch-associates-project-to-repo
MATCH (project:JiraProject {ari: $id})
MATCH (project)-[rel0:project_associated_branch]->(branch:GraphBranch)
MATCH (branch)-[rel1:branch_in_repo]->(repository:GraphRepository)
WHERE NOT (project)-[:project_disassociated_repo]->(repository)
RETURN repository AS ret, GREATEST(MAX(rel0.lastUpdated), MAX(rel1.lastUpdated)) AS lastUpdated

UNION ALL

// Materialization Rule: commit-associates-project-to-repo
MATCH (project:JiraProject {ari: $id})
MATCH (project)-[rel0:project_has_issue]->(issue:JiraIssue)
MATCH (issue)-[rel1:issue_associated_commit]->(commit:GraphCommit)
MATCH (commit)-[rel2:commit_in_repo]->(repository:GraphRepository)
WHERE NOT (project)-[:project_disassociated_repo]->(repository)
RETURN repository AS ret, GREATEST(MAX(rel0.lastUpdated), MAX(rel1.lastUpdated), MAX(rel2.lastUpdated)) AS lastUpdated

UNION ALL

// Materialization Rule: explicitly-associated-project-to-repo
MATCH (project:JiraProject {ari: $id})
MATCH (project)-[rel0:project_explicitly_associated_repo]->(repository:GraphRepository)
WHERE NOT (project)-[:project_disassociated_repo]->(repository)
RETURN repository AS ret, MAX(rel0.lastUpdated) AS lastUpdated

UNION ALL

// Materialization Rule: pr-associates-project-to-repo
MATCH (project:JiraProject {ari: $id})
MATCH (project)-[rel0:project_associated_pr]->(request:GraphPullRequest)
MATCH (request)-[rel1:pr_in_repo]->(repository:GraphRepository)
WHERE NOT (project)-[:project_disassociated_repo]->(repository)
WITH repository AS ret, GREATEST(MAX(rel0.lastUpdated), MAX(rel1.lastUpdated)) AS lastUpdated

RETURN ret, MAX(lastUpdated) AS lastUpdated

Metadata

To Metadata

Ari

When filtering by ARI in GraphQL, it will behave as a String rather than a message as shown below.

NameTypeDescription
valueStringThe ARI string value identifying the provider or resource.

Rate this page: