How to sync CreatedDate from Jira to ADO Custom fields

I am trying to migrated the Jira Created Date to a Custom field in ADO.

i have configured correct but couldnt get it seeing. need expert opinion

Jira Outgoing

replica.created = issue.Created

Azure Incoming

workItem.customFields.“JiraCreatedDate” = replica.created

Incoming script error
java.lang.UnsupportedOperationException

You’re on the right track! To sync the Jira Created Date to a custom field in Azure DevOps, your approach is almost correct, but let’s clarify the setup and double-check a few things.

Based on the official documentation (How to Sync CreatedDate Field and Jira and Azure DevOps Integration), here’s how you should configure your scripts:

Jira Outgoing sync:

replica.created = issue.created

Azure DevOps Incoming sync:

workItem.customFields."JiraCreatedDate" = replica.created

A few things to check:

  • Make sure the custom field “JiraCreatedDate” exists in Azure DevOps and is of a type that can accept date/time values.
  • The field name in the script must match exactly (including case and spaces) the custom field’s name in Azure DevOps.
  • If you still don’t see the value, try logging or temporarily mapping replica.created to the description to confirm the value is coming through.

If you need more details, check out the official docs:

This should get your Created Date syncing as expected!

Thank you so much for the details but didnt work though i have all the mentioned correctly

Hi @pradheep,

Possibly there is a mismatch for the date format coming from Jira. Can you try the following:

// Place import at the top of the ADO Incoming Script
import java.text.SimpleDateFormat

// Only process if replica.created exists
if (replica.created) {
    def formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
    def formattedDate = formatter.format(replica.created)
    workItem.customFields."JiraCreatedDate" = formattedDate
}

Kind regards,

Ariel

I am getting null for the replica.created. though i have this code

if (replica.created) {

workItem.customFields."JiraCreatedDate" = replica.created

}

i will need someones help to fix as this is critica

Hi @pradheep,

Can you fix your Outgoing script if it is actually:

Jira Outgoing

replica.created = issue.Created

since it should be:

Jira Outgoing

replica.created = issue.created

Kind regards,

Ariel

Awesome and my bad on the capital. it worked. Thanks much Ariel

Great! Glad that I was able to help!