firstSync Requiered Date Field, issue.key

Hello,

I try to correct script from exalate for Jira Cloud (try to help).

I - Code :
________

def cfTimeDetection = issue.customFields.‘Time and date of detection’

def detectionDate = replica.customFields.‘Date et heure de Détection’?.value

if (cfTimeDetection && detectionDate) {

  cfTimeDetection.value = detectionDate

} else {

  debug.error(

     "\[SKIP\] Time and date of detection non accessible " +

     "(cf=${cfTimeDetection}, value=${detectionDate})" +         

     "DEBUG CONTEXT firstSync=" + firstSync +

     " issue.key=" + issue.key

  )

_____________

2 - Log:

Error Detail Message:

[SKIP] Time and date of detection non accessible (cf=null, value=2026-04-13 06:30:00.0)DEBUG CONTEXT firstSync=true issue.key=null

_____

3 - Jira conf:

This issue ticket has this field has mandatory. So if we don’t affect the value it will exit with “field 10052 is requiered”.

What can I do ?

Regards,

Hi there,

I see when executing this incoming Jira Cloud script, when defining cfTimeDetection is not reading the custom field object, what type of custom field is it?

Kind regards,

Ariel

Hello,

Thank you.

Time and date of detection : Date Time Picker.

If I changed my code by:

issue.customFields.‘Time and date of detection’ = replica.customFields.‘Date et heure de Détection’

Error Detail Message:

Request type `Incident` requires a custom field 10052 of type `com.atlassian.jira.plugin.system.customfieldtypes:datetime` but none was set through exalate config.

Field 10052 : Time and date of detection

Date et heure de Détection has a value.

Regards

Hi @o.roger.comutitres,

Is it possible the local date format is different from the one received in replica.customFields.‘Date et heure de Détection’

Try the following, add the the field in the Outgoing Script like:

replica.customFields."Time and date of detection" = issue.customFields."Time and date of detection"
debug(issue.customFields."Time and date of detection".value)

Manually add the time and date of detection, and check if the format matches.

Kind regards,

Ariel

Outgoing sync:

if (issue.project?.key == “CEP”) {
replica.customFields.“Time and date of detection” = issue.customFields.“Time and date of detection”

} else if (issue.project?.key == “ESIC”) {
replica.customFields.“Date et heure de Détection” = issue.customFields."Date
}

debug(issue.customFields.“Time and date of detection”.value)
=> I didn’t succeed to read the log anywhere. Evenif I add debug.error script still going to Incoming Sync

Incoming Sync:

def cfTimeDetection = issue.customFields.‘Time and date of detection’

debug.error(cfTimeDetection.value)
=> com.exalate.api.exception.script.ScriptException: Cannot get property ‘value’ on null object

It crash

Also something just happened:

Why issue.key has a value now (before is null) ? I changed almost nothing just added log

def cfTimeDetection = issue.customFields.‘Time and date of detection’

def detectionDate = replica.customFields.‘Date et heure de Détection’?.value

def detection = issue.customFields.“Time and date of detection”?.value

if (cfTimeDetection && detectionDate) {

  cfTimeDetection.value = detectionDate

} else {

  //cfTimeDetection.value = new Date()

  debug.error(

     "\[SKIP\] Time and date of detection non accessible " +

     "(cf=${cfTimeDetection}, value=${detectionDate})" + "DEBUG CONTEXT firstSync=" + firstSync +

     " issue.key=" + issue.key + " " + issue.customFields."Time and date of detection"?.getClass()?.getName() + " Outgoing detection value = " + detection + "Outgoing detection type  = " + detection?.getClass()?.getName()

  )

}

Error Detail Message:

[SKIP] Time and date of detection non accessible (cf=null, value=null)DEBUG CONTEXT firstSync=false issue.key=CEP-28007 null Outgoing detection value = nullOutgoing detection type = null

depend of the ticket

CEP-28007 = issue.key / relica = ESIC-4428

NULL / relica = ESIC-4941

[SKIP] Time and date of detection non accessible (cf=null, value=2026-04-13 06:30:00.0)DEBUG CONTEXT firstSync=true issue.key=null null Outgoing detection value = nullOutgoing detection type = null

issue.key is now null again

Hi @o.roger.comutitres,

Is it possible we can have a quick session using a test ticket, to check it out? Please follow:

Kind regards,

Ariel

Hello,

My colleague Ulrich will be aviaible today 27/04 for a session. I confirm appointement.

Regards

Hi @o.roger.comutitres,

As we concluded over the meeting, it seems the actual issue was with the name of the field, Exalate by some reason was unable to fetch the object and by making the change to use ID of the field, seems to have corrected the situation as we tested. Thanks for your time.

Happy Exalating,

Ariel