Synchronize a Jira timestamp field to servicenow

Originally asked by Serge TAELEMANS on 04 August 2023 (original question)


We try to synchronize a Jira timestamp field to servicenow.

Several time ago we did the same for the problem module with success.

Now we try to do the same for Request Items in servicenow

The Jira field is event timestamp custom field and we use the following code :

if(replica.customFields.eventTimestamp && replica.customFields.eventTimestamp.value){
// Define timestamps
def timestamps = replica.customFields.‘eventTimestamp’.value
// Set a date using the timestamp
def date = new Date(timestamps.time)
// Create a date format as desired
SimpleDateFormat dateFormat = new java.text.SimpleDateFormat(“yyyy-mm-dd hh:mm:ss”)
requestItem.u_event_timestamp = dateFormat.format(date)

When we do a sync we didn’t get an error but the field is not updated.

Thanks for your help.

Regards

Serge