# Jira Custom Fields to Github Labels

**URL:** <https://community.exalate.com/t/jira-custom-fields-to-github-labels/4411>\
**Category:** General Questions\
**Tags:** onpremise-jira, cloud-jira, cloud-github, migrated\_question\
**Created:** [November 4, 2024, 6:55am UTC](https://community.exalate.com/t/jira-custom-fields-to-github-labels/4411 "2024-11-04T06:55:07Z")\
**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, 6:55am UTC](https://community.exalate.com/t/jira-custom-fields-to-github-labels/4411/1 "2024-11-04T06:55:07Z")

</div>

_Originally asked by Juan Grases on 23 October 2020 [(original question)](https://oldcommunity.exalate.com/questions/20120525)_

* * *

I want to create labels on Github based on a Jira custom field value, how can I do that?

* * *

---

<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, 6:55am UTC](https://community.exalate.com/t/jira-custom-fields-to-github-labels/4411/2 "2024-11-04T06:55:14Z")

</div>

_Answer by Juan Grases on 23 October 2020_

Jira Outgoing sync:

```auto
replica.customFields."CF name" = issue.customFields."CF name"

```

Gitub Incoming sync:

```auto
def CfToLabel = ["Cf Value A": "Label1", "Cf Value B": "Label2"]

def remoteValue = replica.customFields."CF name"?.value
def localLabel = nodeHelper.getLabel(CfToLabel[remoteValue])
if(localLabel && !issue.labels.contains(localLabel)){
  issue.labels += localLabel
}

```

That should work!

* * *
