# How to sync Start Date between 2 JIRA Cloud instances

**URL:** <https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566>\
**Category:** General Questions\
**Tags:** jira-cloud, cloud, date, migrated\_question\
**Created:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566 "2024-11-04T08:13:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566/1 "2024-11-04T08:13:27Z")

</div>

_Originally asked by Charlie Schonken on 22 August 2023 [(original question)](https://oldcommunity.exalate.com/questions/88246046)_

* * *

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](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:**

```auto
   replica.due = issue.due
   replica.start = issue.customFields."14107"

```

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:**

```auto
	issue.customFields."10015".value = replica.start.value
	issue.due = replica.due

```

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?

- On both instances the Start Date is a locked field under Custom Fields
- On both instances the Start Date is a _Date Picker_ field

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](https://docs.exalate.com/docs/how-to-synchronize-a-due-date-field-in-jira-cloud)

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566/2 "2024-11-04T08:13:28Z")

</div>

_Answer by Christophe De Beule on 22 August 2023_

Hi Charlie Schonken

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 Sync**

```auto
replica."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

1. Date date = new Date(long date)
2. new Timestamp(long time), **note** that you’ll need to import “java.sql.Timestamp”.

**Incoming Sync**

```auto
import 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

* * *

#### Comments:

> **Charlie Schonken commented on 23 August 2023**
>
> > Worked like a charm - much appreciated

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 4, 2024, 8:13am UTC](https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566/3 "2024-11-04T08:13:29Z")

</div>

_Answer by Richard K on 05 September 2023_

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

* * *

---

<div class="post-metadata">

**Author:** ![xl8bot](https://dub1.discourse-cdn.com/flex018/user_avatar/community.exalate.com/xl8bot/32/324_2.png) [@xl8bot](https://community.exalate.com/u/xl8bot)\
**Post date:** [November 6, 2024, 8:14am UTC](https://community.exalate.com/t/how-to-sync-start-date-between-2-jira-cloud-instances/5566/4 "2024-11-06T08:14:22Z")

</div>

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