One way Sync system field to custom field

Originally asked by Destri Weir on 20 January 2022 (original question)


I want to sync the Status field from one project to a custom field Engineering status in another project. I only want it to be a one-way sync from project B to project A.

I have this code in my Incoming Sync, but itā€™s not working:

issue.status = replica.customFields. ā€œEngineering Statusā€


Answer by Destri Weir on 20 January 2022

Since I am writing from a list field to a text field, I also tried ā€œissue.customFields.ā€œEngineering Statusā€?.value = replica.status?.collect{it.name}.join(ā€,ā€œ)ā€ in the Incoming Sync, but I am still getting the error above.


Answer by Destri Weir on 20 January 2022

Salma Nairi

So I made those edits:

Outgoing:

replica.status = issue.status

Incoming:

issue.customFields. ā€œEngineering Statusā€?.value = replica.status?.name

but Iā€™m now getting this error:

Jira Cloud error
Field Field ā€˜customfield_10177ā€™ cannot be set. It is not on the appropriate screen, or unknown.: customfield_10177.

I verified and that is the ID for the Engineering Status field which is on the project A side. It is on the engineering screen, but it was added after the connection was initiated.


Answer by Salma Nairi on 20 January 2022

Hi

it should be like that

outgoing

replica.status = issue.status ( you have to send status from project B)

In incoming

issue.customFields. ā€œEngineering Statusā€?.value ( custom filed on project A) = replica.status?.name ( project B status)