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 PR

The ProjectAssociatedPr relationship represents the link between Jira project and external pull request within the Teamwork Graph. It allows you to:

  • Retrieve external pull requests associated with a specific Jira project
  • Find which Jira projects are associated with an external pull request
  • Traverse and analyze project-pull-request relationships

Relationship type: Canonical

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

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 ProjectAssociatedPr_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 DevOpsPullRequestDetails {
           id
          }. on ExternalPullRequest {
           id
          }
         }
        }
       }. on GraphStoreCypherQueryV2AriNode {
        data {. on DevOpsPullRequestDetails {
          id
         }. on ExternalPullRequest {
          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_pr]->(request:GraphPullRequest) RETURN request",
 "params": {
  "id": "$id"
 }
}

Inverse query

GraphQL
1
2
query ProjectAssociatedPr_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_pr]->(request:GraphPullRequest {ari: $id}) RETURN project",
 "params": {
  "id": "$id"
 }
}

Materialization via Cypher Experimental

This materialization rule automatically creates project_associated_pr relationships by traversing from Jira projects through their issues to find associated pull requests.

Cypher
1
2
// Materialization Rule: issue-associates-project-to-pr
MATCH (project:JiraProject {ari: $id})
MATCH (project)-[rel0:project_has_issue]->(issue:JiraIssue)
MATCH (issue)-[rel1:issue_associated_pr]->(request:GraphPullRequest)
RETURN request AS ret, MAX(rel1.lastUpdated) AS lastUpdated

Metadata

To metadata

Relationship metadata

NameTypeDescription
assigneeAriAri (Message)ARI of the user assigned to the connecting issue.
statusAriAri (Message)ARI of the current status of the connecting issue.
issueAriAri (Message)ARI of the issue that connects the project to the pull request.
creatorAriAri (Message)ARI of the user who created the connecting issue.
reporterAriAri (Message)ARI of the user who reported the connecting issue.
issueLastUpdatedOnLongTimestamp when the connecting issue was last updated.
sprintArisAri (Message)ARIs of sprints containing the connecting issue.

Reviewer

Author

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 user or resource.

PullRequestStatus

NameInternal NameIndexDescription
not-setPR_STATUS_NOT_SET0No status has been set for this pull request.
openPR_STATUS_OPEN1Pull request is open and awaiting review or action.
mergedPR_STATUS_MERGED2Pull request has been successfully merged into the target branch.
declinedPR_STATUS_DECLINED3Pull request has been declined and will not be merged.
unknownPR_STATUS_UNKNOWN4Pull request status cannot be determined.
draftPR_STATUS_DRAFT5Pull request is in draft mode and not ready for review.

ReviewerStatus

NameInternal NameIndexDescription
not-setPR_REVIEWER_STATUS_NOT_SET0No review status has been set by this reviewer.
approvedPR_REVIEWER_STATUS_APPROVED1Reviewer has approved the pull request changes.
unapprovedPR_REVIEWER_STATUS_UNAPPROVED2Reviewer has not approved the pull request changes.
needsworkPR_REVIEWER_STATUS_NEEDSWORK3Reviewer has requested changes or additional work be done.

Rate this page: