# How to sync multiple Github Pull request to single Jira issue

**URL:** <https://community.exalate.com/t/how-to-sync-multiple-github-pull-request-to-single-jira-issue/5306>\
**Category:** General Questions\
**Tags:** exalate, script, github, migrated\_question\
**Created:** [November 4, 2024, 7:56am UTC](https://community.exalate.com/t/how-to-sync-multiple-github-pull-request-to-single-jira-issue/5306 "2024-11-04T07:56:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:56am UTC](https://community.exalate.com/t/how-to-sync-multiple-github-pull-request-to-single-jira-issue/5306/1 "2024-11-04T07:56:47Z")

</div>

_Originally asked by Varun Joseph Allu on 03 October 2022 [(original question)](https://oldcommunity.exalate.com/questions/58495046)_

* * *

Hi Team ,

We have a business requirement to sync multiple Github Pull Request to Single Jira issue.Is that possible ?  
If possible please help with your inputs.

Thank you,  
Varun

* * *

#### Comments:

> **Ariel Aguilar commented on 05 October 2022**
>
> > Hi Varun,
> 
> In this example, we are going to set a connection from GitHub to Jira Server. And sychronize multiple pull requests to a single Jira issue.
> 
> GitHub Outgoing:
> 
> In the GitHub pull request, you add on the description the Jira issue (For example: TEST-123) you want to connect to.
> 
> ```auto
> replica.key = issue.key
> replica.summary = issue.summary
> replica.description = issue.description
> replica.labels = issue.labels
> replica.comments = issue.comments
> replica.type = issue.type  
> 
> ```
> 
> After you Exalate the ticket in GitHub (You could manually do it using Entity sync status or set a trigger to match the criteria and use something like:
> 
> ```auto
> repo:Exalate-Team/Test is:pr label:exalate
> 
> ```
> 
> Jira Incoming:  
> This script will be executed in Jira Server. It will connect the corresponding tickets.
> 
> ```auto
> def remoteIssueUrn = replica.description
> if(remoteIssueUrn && firstSync){
> def localIssue = com.atlassian.jira.component.ComponentAccessor
> .issueManager
> .getIssueObject(remoteIssueUrn)
> if(localIssue == null) throw new com.exalate.api.exception.IssueTrackerException("Issue with key "+remoteIssueUrn+" was not found")
> if(replica.type.name == "Pull Request"){
> issue.typeName = localIssue.type.name
> issue.projectKey = localIssue.projectObject.key   
> issue.id = localIssue?.id
> issue.key = localIssue?.key
> return;
> }
> }
> issue.summary = replica.summary
> issue.description = replica.description
> issue.comments = commentHelper.mergeComments(issue, replica)
> issue.labels = replica.labels
> 
> ```
> 
> And like this, you can connect multiple pull requests to the same Jira issue.  
> Kind regards,
> 
> Ariel

> **Varun commented on 31 October 2022**
>
> > We faced this error when we tried the above script
> 
> [exalate\_support\_githubnode\_5.4.4\_20221013-083625.zip](https://oldcommunity.exalate.com/download/attachments/58495046/exalate_support_githubnode_5.4.4_20221013-083625.zip?version=1&modificationDate=1667190264076&api=v2)_(old community)_

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 7:56am UTC](https://community.exalate.com/t/how-to-sync-multiple-github-pull-request-to-single-jira-issue/5306/2 "2024-11-04T07:56:48Z")

</div>

_Answer by Varun on 07 November 2022_

Hi Ariel,

We tried with the your script.  
Not able to sync multiple PR’s with single Jira issue.  
Are you able to do this in your system ?

Please help with your inputs on this.

Thank you,  
Varun

* * *

#### Comments:

> **Ariel Aguilar commented on 07 November 2022**
>
> > Hi Varun,
> 
> The suggested script was not found on the support logs you provided, could you set a video and share it to see what is not working?
> 
> Kind regards,
> 
> Ariel
