2 answers
- 210
It's not updating because the date time field does not recognize the format that's been sent over (1.683504E12).
To do this you need to apply a few changes in your script.
If you want to sync the “Start date” field you can use the Timestamp method.
The “Start date” is indeed a custom field in Jira Cloud, but you can access it in Exalate by doing:Outgoing Syncreplica."Start date" = issue."Start date"
If you use this format you don't need to use the “.value” later on.
Now in the Incoming script you need 2 things- Date date = new Date(long date)
- new Timestamp(long time), note that you'll need to import “java.sql.Timestamp”.
Incoming Syncimport java.sql.Timestamp Date date = new Date((long)replica."Start date") issue."Start date" = new Timestamp(date.time)
From the Start date custom field you'll get a double in unixtime (replica."Start date" = 1.683504E12) or (replica."Start date" = 168350400000).
This format needs to be converted, to do this use the Date object. The Date object expects a long, so we cast this by putting (long) before our variable.We use Timestamp to convert it to a date time object in Jira.
With the imported “java.sql.Timestamp” library you can call a new timestamp by new Timestamp(long date).Set the issue “Start date” = new Timestamp(date.time).
Now you should see your Start date in your issues.I hope this answers your question?
Thanks,
Christophe
CommentAdd your comment... - 10-1
Hi!
In our Exalate sync this works too:- outgoing: replica.customFields."Start date" = issue.customFields."Start date"
- incoming: issue.customFields."Start date" = replica.customFields."Start date"
Best regards,
Richard
CommentAdd your comment...
I know this has been asked a few times, but none of the documentation seems to help me.
https://docs.exalate.com/docs/how-to-sync-datedatetime-custom-fields-in-jira-cloud
Use Case:
I want to sync issue start date from one Jira cloud instance to another Jira cloud instance
I already do this with Due Date
Outbound sync from instance A:
I did a quick debug.error(replica.start.value) output check on instance A and the Start Date is displayed as Mon May 08 00:00:00 UTC 2023
Inbound sync to instance B:
I did a quick debug.error(replica.start.value) output check on instance B and the Start Date is displayed as 1.683504E12
It is not updating the field on instance B at all. Leaving me to wonder why it shows a weird number value on instance B?
What am I doing wrong?
Ps. The Due Date sync seems to work differently as per documentation found and is working correctly
https://docs.exalate.com/docs/how-to-synchronize-a-due-date-field-in-jira-cloud