# SF to JIRA sync script need proper case number mapping

**URL:** <https://community.exalate.com/t/sf-to-jira-sync-script-need-proper-case-number-mapping/5439>\
**Category:** General Questions\
**Tags:** jira, configuration, salesforce, custom-fields, migrated\_question\
**Created:** [November 4, 2024, 8:04am UTC](https://community.exalate.com/t/sf-to-jira-sync-script-need-proper-case-number-mapping/5439 "2024-11-04T08:04: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, 8:04am UTC](https://community.exalate.com/t/sf-to-jira-sync-script-need-proper-case-number-mapping/5439/1 "2024-11-04T08:04:47Z")

</div>

_Originally asked by Support on 10 March 2023 [(original question)](https://oldcommunity.exalate.com/questions/58500000)_

* * *

Hello,

We need to map actual SalesForce case number (like 05934910) to a custom field on Jira side, right now we are getting a value like this: 500Di00000R0auZIAR

Current SF mapping is like this for the field

**SF Outgoing sync**

```auto
if(entity.entityType == "Case") {
  replica.key = entity.Id
  replica.summary = entity.Subject
  replica.description = entity.Description
  ....
}

```

**Jira incoming sync**

```auto
else if (issue.projectKey == "NUM"){issue.customFields."SalesForce Case Number".value = replica.key}

```

We would like to have the proper field that needs to be sent from SF to have the actual case number instead of the long string we are currently getting.

 ![](https://europe1.discourse-cdn.com/flex018/uploads/exalate1/original/1X/1335aef2e47300912ca30b7b6a6660e7647e1505.png)

* * *

#### Comments:

> **Ariel Aguilar commented on 10 March 2023**
>
> > Try
> 
> **SF Outgoing sync**
> 
> ```auto
> if(entity.entityType == "Case") {
> replica.key = entity.Id
> replica.summary = entity.Subject
> replica.description = entity.Description
> replica.number = entity.CaseNumber
> }
> 
> ```
> 
> **Jira incoming sync**
> 
> ```auto
> else if (issue.projectKey == "NUM"){
> issue.customFields."SalesForce Case Number".value = replica.number
> }
> 
> ```
> 
> Kind regards,
> 
> Ariel

---

<div class="post-metadata">

**Author:** ![Javier](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/javier/32/338_2.png) [@Javier](https://community.exalate.com/u/Javier)\
**Post date:** [May 23, 2025, 1:55am UTC](https://community.exalate.com/t/sf-to-jira-sync-script-need-proper-case-number-mapping/5439/2 "2025-05-23T01:55:33Z")

</div>


