How to sync a SF field into a Jira Cloud component

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.

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
1 Like

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

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