1
0
-1

Hello,


I am trying to set up a one-way sync between Azure DevOps (source) and Jira Cloud (destination).  I have the sync working with the exception of the Target Date field.


The remote payload shows the date as follows:


customKeys": {
    "Target Date": "2022-01-31T00:00:00Z"
}


I've followed another users example here: Sync Due Date from Azure DevOps to JIRA cloud


But keep getting an error when trying to format the data as a date.  When I try to put that data into a text field for troubleshooting, I get a weird field value ([B@2abd3e2c).  I feel like I'm close but missing something obvious, has anyone else had issues with this and if so, how did you resolve them?


Thanks!

  1. Jose Pablo Alpizar Hidalgo

    Hello Chris Rogers 

    Just to narrow down the case, would you please verify that the definition is set well set on the Azure DO project by following the next article's steps:
    https://keithbabinec.com/2021/02/28/how-to-visually-highlight-overdue-work-items-on-an-azure-devops-sprint-board/
    Would you please also share with us what is your connection type is and the error message you get?


CommentAdd your comment...

1 answer

  1.  
    1
    0
    -1

    Hi Jose,


    Confirmed.  The Target Date field is set up as a Date/Time field in ADO.  I first tried to set this up as a visual connection with a small script to copy the value over but that didn't work so I've setup a scripted connection.


    The error I get is: Cannot format given object as a Date.

    1. Ariel Aguilar

      Hi Chris,

      I guess you are trying to sync to a date and time picker custom field in Jira Cloud?

      Kind regards,

      Ariel

    2. Chris Rogers

      Hi Ariel,


      I am trying to take a work item in Azure DevOps and sync several fields into an issue in Jira Cloud.  I've got the rest of the sync working, but the date/time picker from Azure DevOps (named Target Date) syncing into Jira Cloud (also named Target Date) is proving to be a challenge.

    3. Ariel Aguilar

      Try this:

      issue.customFields."Target Date".value =  new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").parse(replica.customKeys."Target Date".replace("Z","CST"))

      When parsing the text the Z it is expecting a value instead of variable, so to get it sorted we are replacing the Z by an abbreviation of the system timezone so make sure the value gets properly added. Otherwise, so might get the value added with the default UTC offset timezone provided by the API. 

      Kind regards,

      Ariel

    4. Chris Rogers

      Hi Ariel,


      Thanks!   This was what I was looking for and worked wonderfully; the time zones don't match between the instances but we can live with that for now.


      Thanks so much!

    CommentAdd your comment...