Jira Custom field - Requester Zendesk

Originally asked by Christos Katsivas on 02 July 2020 (original question)


Hi team,

Can I sync a Jira text field with Requester to Zendesk, in the case, when i create tickets from Jira to Zendesk?

Thank you!Source: Zendesk (old community)


Answer by Roman on 03 July 2020

Hi Christos Katsivas,

issue.customFields."URequester".value = nodeHelper.getUserByUsername(replica.customField."Jira Text"?.value)

You can do

  


Comments:

Christos Katsivas commented on 03 July 2020

Hi,

URequester is the Zendesk system user field? Also, in the outgoing in Jira its required to write the following?

replica.customFields.“Jira Text” = issue.customFields.“Jira text”

Christos Katsivas commented on 03 July 2020

Also, It does not works. I get the following error.

Script error details: Cannot get property ‘Customer’ on null object. Error line: Script715.groovy:176

Juan Grases commented on 03 July 2020

Hi!

Yes you need to add

replica.customFields."Jira Text" = issue.customFields."Jira text"

To your Jira Outgoing, replacing Jira Text with the actual CF name. Regarding the error you are having, it means that you are suing .Customer on something that is null. Are you sure that ‘Customer’ is the name of the CF?

Juan Grases commented on 03 July 2020

Hi Christos, I realise now that this is not a custom field on Zendesk. Could you try doing:

issue.reporter = nodeHelper.getUserByUsername(replica.customField."Jira Text"?.value)


You can also use

nodeHelper.getUserByUsername
nodeHelper.getUserByEmail
nodeHelper.getUser
Roman commented on 13 July 2020

Hi Christos Katsivas ,

Can you try issue.reporter = nodeHelper.getUserByEmail(replica.customFields.“Mood”?.value)