xl8bot
November 4, 2024, 8:17am
1
Originally asked by Thorsten on 01 November 2023 (original question)
Hi,
I have a problem with syncing ADO custom field’s to Jira Cloud.
The following fields are defined in ADO:
on ADO side the outgoing script looks like this:
replica.customFields."Start Date" = workItem.customFields."Start Date"
replica.customFields."Effort" = workItem.customFields."Effort"
on Jira Cloud side the incoming script looks like this:
if (replica.customFields."Start Date") {
issue.customFields."10015" = replica.customFields."Start Date".value ?: ""
}
if (replica.customKeys."Effort") {
issue.customFields."10363" = replica.customKeys."Effort".value ?: ""
}
On ADO side the 3 fields have a value but in Jira the fields are empty and there is no error during the sync.
I also tried it on Jira side with the field name and also with the “.value” extension without any success.
Where is my mistake?
Best regards
Thorsten
xl8bot
November 4, 2024, 8:17am
2
Answer by Tomas Eduardo Lalanne on 10 November 2023
Hi Thorsen!
The answer was also provided on the ticket opened, but here is the answer as well.
ADO Outgoing
replica."start" = workItem."Microsoft.VSTS.Scheduling.StartDate"
replica."target" = workItem."Microsoft.VSTS.Scheduling.TargetDate"
Jira Incoming
import java.text. SimpleDateFormat;
import java.text.DateFormat;
def datePattern = "yyyy-MM-dd HH:mm:ss";
DateFormat formatter = new SimpleDateFormat(datePattern);
dateString = replica."start"
dateString = dateString.replaceAll("T"," ").trim();
dateString = dateString.replaceAll("Z"," ").trim();
date = formatter.parse(dateString);
issue.customFields."Start date".value = date
Have a great day
xl8bot
November 4, 2024, 8:17am
3
Answer by Jillani Fazal on 01 November 2023
Hi Thorsten,
Thank you for connecting via community portal. I would suggest you check these articles:
How to sync Start Date across 2 Jira instances? (old community)
https://docs.exalate.com/docs/how-to-synchronize-custom-fields-in-jira-cloud
I hope that the shared information will be helpful and let me know the outcome.
BR,
Jillani
Comments:
Thorsten commented on 01 November 2023
Hi Jillani,
as mentioned I also tried it with these lines:
ADO Outgoing
replica.customFields."Start Date" = workItem.customFields."Start Date"
Jira Incoming
if (replica.customFields."Start Date") {
issue.customFields."Start Date".value = replica.customFields."Start Date".value ?: ""
}
This is also described in the two links you provided. But it just doesn’t work, no data is simply entered into the field in Jira.
Therefore, your answer was unfortunately not effective. (old community)
What also confuses me a bit is that the field exists with a value in ADO, but when I check the ticket via an API request the “Start Date” field doesn’t appear. But the effort field does and that is not synchronized either.
BR,
Thorsten
xl8bot
Closed
November 6, 2024, 8:17am
4
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.