# How to sync a SF field into a Jira Cloud component

**URL:** <https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112>\
**Category:** General Questions\
**Tags:** jira-cloud, salesforce, components\
**Created:** [January 13, 2025, 2:15pm UTC](https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112 "2025-01-13T14:15:29Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [January 13, 2025, 2:15pm UTC](https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112/1 "2025-01-13T14:15:29Z")

</div>

I have been talking to AIDA trying to get support for syncing the component field of an issue coming from Salesforce, but every suggestion has been throwing an error. The latest suggestion it gave me was to make this my incoming script sync (which threw an error):  
issue.components = replica.Module.value ? [new Component(name: replica.Module.value)] : null

The initial script I had for trying to take the “Module” being sent from the Salesforce end and put it into the Jira component field is: issue.components = replica.Module.value but this also threw an error.

---

<div class="post-metadata">

**Author:** ![zhandzlik](https://avatars.discourse-cdn.com/v4/letter/z/ce73a5/32.png) [@zhandzlik](https://community.exalate.com/u/zhandzlik)\
**Post date:** [January 13, 2025, 3:23pm UTC](https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112/2 "2025-01-13T15:23:04Z")

</div>

I was able to get this to work. Here is my code:  
def component = nodeHelper.getProject(issue.project?.key ?: issue.projectKey).components.find {c-\> c.name == replica.Module?.value}

```
issue.components += component

```

---

<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:** [January 13, 2025, 4:49pm UTC](https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112/3 "2025-01-13T16:49:42Z")

</div>

I’m glad you found a solution for this. Thanks for sharing the script!

---

<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:** [January 14, 2025, 4:50pm UTC](https://community.exalate.com/t/how-to-sync-a-sf-field-into-a-jira-cloud-component/6112/4 "2025-01-14T16:50:38Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
