# Multiple Configuration Scenarios: Jira to Github

**URL:** <https://community.exalate.com/t/multiple-configuration-scenarios-jira-to-github/5483>\
**Category:** General Questions\
**Tags:** jira, configuration, github, migrated\_question\
**Created:** [November 4, 2024, 8:07am UTC](https://community.exalate.com/t/multiple-configuration-scenarios-jira-to-github/5483 "2024-11-04T08:07:24Z")\
**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, 8:07am UTC](https://community.exalate.com/t/multiple-configuration-scenarios-jira-to-github/5483/1 "2024-11-04T08:07:24Z")

</div>

_Originally asked by Jillani Fazal on 05 May 2023 [(original question)](https://oldcommunity.exalate.com/questions/58501651)_

* * *

I already checked on these docs and tried. but it didn’t work. Can you please provide me the code snippet to use in incoming and outgoing sync by checking our current mentioned above? Please note that we are trying to move issues from **JIRA to GitHub**

1. Sync assignees

[https://docs.exalate.com/docs/how-to-sync-assignees-on-github](https://u30673958.ct.sendgrid.net/ls/click?upn=VDjl6ofiy6ZFrZGic7cl-2FoD2HTNIQKYMzN3Rt3CxjwWxXFmiV3Hb-2BtA-2FVYp0VB5lfs7ZDP9wd3f3dIo-2FDJAMiRgOf5-2BslWpgTebAASAnEjo-3DVpgF_bFVxeb2EW-2BH5WcaHXl3yXJ4xFq0UEvPTZUrBlYgzX7uczAc06k994jhnXZayhT27hBZfmdwkZOQrZY9-2FBVzFTO5pVwYM7MQjAy01hZTaL-2BfYGV51Y5uy-2B-2B9uBGsgi5F4a0oTtD8koSsGSqoIXi0tXdQee24PkeMwrqCaj4DwkNN9CIrM3w-2Bz5YCLqv5ioTYtV-2FM5fnlJ7rh-2Bqh98l6YYuA-3D-3D) : **This document is for GH to GH sync. However, we have added the assignee parameter in our code above and tried but it didn’t work. please check the code snippets in the above mail**

2. Sync Jira ticket status and map to GH statuses (closed or opened) if possible  
[https://docs.exalate.com/docs/search?phrase=status&Search=](https://u30673958.ct.sendgrid.net/ls/click?upn=VDjl6ofiy6ZFrZGic7cl-2FoD2HTNIQKYMzN3Rt3CxjwUDGLv6AxgQmhdvebx858SSTAlfY-2Bvrz6xlrR2TayemW9fBnP-2BDQh7iLT5Y3G1DFGY-3DvcOv_bFVxeb2EW-2BH5WcaHXl3yXJ4xFq0UEvPTZUrBlYgzX7uczAc06k994jhnXZayhT279PhAa5NvOby2g69DbpVL2NA3ITopaDzjTMq2kkqYKOnWjdV-2F5wpQp2pOkdP1JDd-2FP-2FVpkycnG8iwR50yTZA-2FMjAT7y2OtAnZkS-2FzlIro9vGr5XRGO2aRZOmsBG4bgH2on7TkDqZ-2Blu9axpxCM4Zirg-3D-3D) : **We couldn’t find a proper answer in these docs, we already checked on the docs. can you please pinpoint the exact code snippet?**

3. Sync Jira releases (fixVersion) to Gihub milestones or labels:  
[https://docs.exalate.com/docs/search?phrase=milestones&Search=](https://u30673958.ct.sendgrid.net/ls/click?upn=VDjl6ofiy6ZFrZGic7cl-2FoD2HTNIQKYMzN3Rt3CxjwUDGLv6AxgQmhdvebx858SS-2Fsnu8YiGtMigQSjBYL9vnrkJQ-2F7UThagmZz1lJvvhIY-3DOKLI_bFVxeb2EW-2BH5WcaHXl3yXJ4xFq0UEvPTZUrBlYgzX7uczAc06k994jhnXZayhT27kZbYnHYOJKPeFA9mSBXjFU0A2KztKyLUGV0acH8JbjAqGvcPXTiDzkRnwReIRC5Khx7NGH77F3ParWJyLQxz-2BH2AnFjyR253uz2Dvm2EAiEOBJuD-2FzisVJl6hIDhGeLf90LkHobDqxw3fKkHUqxZmg-3D-3D) : **These articles show how to synchronize milestones from GitHub issues to Jira only. we want the code snippets for the opposite way around, however we tried the code snippets given [here](https://docs.exalate.com/docs/how-to-sync-milestones-from-github-to-jira) as well but didn’t work. Please check the code snippets in the above mail**  
Sync links between Jira issue and Jira release (fix version) - not needed. this is same as the above “Sync Jira releases (fix version) to Gihub milestones or labels:”

4. Sync links between Jira issues and PRs  
**we want to move the PR links under the development attribute in JIRA to GH issues as a comment or anything**

_(Posted on the behalf of the client)_

* * *

[Failed to download attachment: attachment\_58501651\_\_thumb\_131973.png. Error: 401 Client Error: for url: [Select Identity Provider - Jira - Idalko](https://support.idalko.com/secure/thumbnail/131973/_thumb_131973.png)]

---

<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, 8:07am UTC](https://community.exalate.com/t/multiple-configuration-scenarios-jira-to-github/5483/2 "2024-11-04T08:07:25Z")

</div>

_Answer by Jillani Fazal on 31 May 2023_

1. Sync assignees

We will map this, meaning, the JC email, to the GH id. Like this; (make sure the assignee is getting send over from Jira Cloud)

Put this on incoming GH side please;

```auto
def userMapping = ["mathieu.lepoutre@idalko.com" : "mathieulepoutrebelgium”]
                issue.assignee = nodeHelper.getUserByUsername(userMapping[replica.assignee?.email])  

```

```auto
  
  

```

2. Sync Jira ticket status and map to GH statuses (closed or opened) if possible.

Put this on incoming GH side please;

```auto
def statusMap = [

       // "remote status name": "local status name"          
   		 "To Do" : "open" ,
         "Done" : "closed" ]
def remoteStatusName = replica.status.name
issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)  

```

```auto
  
  

```

3. Sync Jira releases (fixVersion) to Gihub milestones or labels:

Put this on outgoing JC side:

```auto
replica.fixVersions = issue.fixVersions
replica.affectedVersions = issue.affectedVersions

```

```auto
  

```

On the incoming sync in GitHub, please put this code;

```auto
if(firstSync){
issue.repository = "mathieulepoutrebelgium/Exalate"
}
issue.summary = replica.summary
issue.description = replica.description
issue.comments = commentHelper.mergeComments(issue, replica)
if(replica.fixVersions[0]){
   issue.labels += nodeHelper.getLabel("${replica.fixVersions[0].name}")
} 

```

We are going to check with an if-statement if a fixVersion was selected on the source (Jira Cloud) side, if so, we are adding the name as a label in GitHub.

The label has to exist before it is possible for Exalate to select it.

(updating as per the Mathieu’s replies to the client)

```auto
  

```

* * *
