Salesforce Case Custom Date Field >>> JIRA Custom Date Field

I have a Salesforce Case Custom Date field that I am trying to send to a JIRA custom date Field. I can see the long value in the remote replica but the field in JIRA is blank, there are no errors on the connection.

Salesforce Case Outgoing
replica.Escalation_Due_Date__c = entity.Escalation_Due_Date__c

Jira Incoming
import java.text.SimpleDateFormat;
def Date = new SimpleDateFormat(“MM-dd-yyyy”)
if (replica.customDateField) {
issue.customFields.“SLA Resolution Due Date”.value = new Date(replica.customDateField.longValue())
}

Nevermind I found the Issue I was not defining the Custom Field here is the fix

import java.text.SimpleDateFormat;
def Date = new SimpleDateFormat(“MM-dd-yyyy”)
if (replica.Escalation_Due_Date__c) {
issue.customFields.“SLA Resolution Due Date”.value = new Date(replica.Escalation_Due_Date__c.longValue())
}

under Replica script I had to enter the Salesforce API name

Dear @Jacob_Kalaj

What type of custom field is it in Jira?

Can you try this:

import java.text.SimpleDateFormat

if (replica.customDateField) {
    def sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") 
    def dateValue = new Date(replica.customDateField.longValue()) 
    issue.customFields."SLA Resolution Due Date".value = sdf.format(dateValue) 
}

Let me know how it goes,
Thank you.

Kind regards,
Mathieu Lepoutre

hey @mathieu , I actually responded above realized my mistake In the Replica I never defined the custom field what ended up working was

import java.text.SimpleDateFormat;
def Date = new SimpleDateFormat(“MM-dd-yyyy”)
if (replica.Escalation_Due_Date__c) {
issue.customFields.“SLA Resolution Due Date”.value = new Date(replica.Escalation_Due_Date__c.longValue())
}

1 Like

Dear @Jacob_Kalaj
Ok, thats perfect!
Happy Exalating and have a fantastic day

Thank you as always for quick response! Have a good day

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