solidify / jira-azuredevops-migrator

Tool to migrate work items from Atlassian Jira to Microsoft Azure DevOps/VSTS/TFS.
MIT License
261 stars 227 forks source link

When item that is closed is migrated, ADO shows: Field 'Closed Date' cannot be empty #793

Closed csaket closed 1 year ago

csaket commented 1 year ago

Describe the problem Migration of a Bug with status Closed from Jira Server 8.6 to ADO, workitem of type Bug created correctly, with correct State of Closed. Issue is that ADO now gives this error: Field 'Closed Date' cannot be empty.

Is there anything special that I might have missed out? I am using mapping to a CMMI based process. For Closed, the status to State mapping is just:

        {
          "source": "Closed",
          "target": "Closed"
        },
Alexander-Hjelm commented 1 year ago

This should work fine, and has worked fine for each of my migrations, so most likely it is due to some configuration in your ADO process model.

Have you modified the Bug process or made any changes to the XML model?

Do you have the Bypass rules on workitem update permission in the target ADO project?

jus062 commented 1 year ago

I noticed this behaviour today as well, but am getting it for all Closed items when using v3.0.129

I've run a test using our old version 2.3.117 and it works correctly.

Alexander-Hjelm commented 1 year ago

Strange, because it works just fine in our tests.

@jus062 are you also using a CMMI-based model like @csaket ?

jus062 commented 1 year ago

No, I'm using an inherited agile process. We do have rules on Tasks and Stories, but I disabled those before migrating.

jus062 commented 1 year ago

Ok, I just reran one test work item on v3.0.129 and this is what I see

image

and this is from the json

  "Time": "2023-06-05T21:42:50.758+10:00",
  "Index": 12,
  "Fields": [
    {
      "ReferenceName": "System.State",
      "Value": "Closed"
    }
  ],
Alexander-Hjelm commented 1 year ago

Ok! marking as bug

RoyalWulf commented 1 year ago

Hi Getting this issue as well. I don't have a closed date on any closed work items I don't have an activated date on any work items either. Should I on Active work items?

UweStein commented 1 year ago

We also have the same problem. I can also confirm that this behavior occurs with version v3.0.129. A separate customizing is not defined. The only way out is to set the status to an active one and close it again. But that changes the date. The only thing that surprises me is that this is a field that is set by the system. How can this be empty? It would be nice if you could find a solution, as the newer versions would solve other problems.

We only have the message for the work item Type Task. If the User Story or Bug type, the message is not displayed. The field is also empty and will be populated when the status Closed is returned and reset.

From the json it looks good image

Alexander-Hjelm commented 1 year ago

@UweStein , @RoyalWulf , this issue comes from a bug in the tool. The field Microsoft.VSTS.Common.ClosedDate needs to be set to the revision's Time. Otherwise the ADO Work Item form GUI will complain.

This is an issue when using the WIT Rest API with the Bypass rules on work item updates flag set to true.

I will work on a fix and release anew, most likely during this week or the next!

Alexander-Hjelm commented 1 year ago

See WiClientUtils.CorrectClosedByAndClosedDate, lines 625 - 644. The method considers the state "Done", but should also consider "Closed" and possibly "Resolved"

RoyalWulf commented 1 year ago

Hi, When are you going to make a new release? There are several bugs (including this one) that are fixed and we would really like the fixes. Cheers, John


John Edwards

Agile Enablement Lead

Digital Services

Te Ratonga Tautoko Hangarau

T: +64 3 369 3459 (Internal 93459)

University of Canterbury | Te Whare Wananga o Waitaha

Private Bag 4800, Christchurch 8140, New Zealand



From: Alexander Hjelm @.> Sent: Tuesday, 25 July 2023 12:57 am To: solidify/jira-azuredevops-migrator @.> Cc: John Edwards @.>; Mention @.> Subject: Re: [solidify/jira-azuredevops-migrator] When item that is closed is migrated, ADO shows: Field 'Closed Date' cannot be empty (Issue #793)

Closed #793https://github.com/solidify/jira-azuredevops-migrator/issues/793 as completed via #812https://github.com/solidify/jira-azuredevops-migrator/pull/812.

— Reply to this email directly, view it on GitHubhttps://github.com/solidify/jira-azuredevops-migrator/issues/793#event-9899940901, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYWCEKIVGYRI2BXRTDKAVMDXRZWKTANCNFSM6AAAAAAZQK3PRA. You are receiving this because you were mentioned.Message ID: @.***>

This email may be confidential and subject to legal privilege, it may not reflect the views of the University of Canterbury, and it is not guaranteed to be virus free. If you are not an intended recipient, please notify the sender immediately and erase all copies of the message and any attachments.

Alexander-Hjelm commented 1 year ago

@RoyalWulf, I have released a new version (3.0.159), but seems like we are dealing with permission issues. I am unable to promote v3.0.159 to the latest release. In the meantime you can download it here: https://github.com/solidify/jira-azuredevops-migrator/releases/tag/v3.0.159

Alexander-Hjelm commented 1 year ago

@RoyalWulf I have now promoted v3.0.159 to be the latest release :)

eplnde commented 1 year ago

@Alexander-Hjelm After this fix I seem to get a "The value for field 'Closed Date' must be empty." after migrating bugs that have be reopened (had their state changed from Closed to New)

Alexander-Hjelm commented 1 year ago

@eplnde , Ok! I'm reopening this issue. I'll try and look at it ASAP.

surendra-github commented 1 year ago

Thank you so much !!

Alexander-Hjelm commented 1 year ago

To reproduce the error:

  1. Create a bug in Jira with the To Do status
  2. Move the bug to Closed
  3. Reopen the bug (move to active)
  4. Run an export
  5. Run an import

Here is a sample workitem .json file that successfully recreates the error:

{
  "Type": "Bug",
  "OriginId": "AGILEDEMO-34",
  "WiId": -1,
  "Revisions": [
    {
      "Author": "alexander.hjelm@solidify.dev",
      "Time": "2023-10-07T09:03:50.441+02:00",
      "Index": 0,
      "Fields": [
        {
          "ReferenceName": "System.Title",
          "Value": "[AGILEDEMO-34] (Jira smoke tests) bug with status closed"
        },
        {
          "ReferenceName": "Microsoft.VSTS.Common.Priority",
          "Value": "3"
        },
        {
          "ReferenceName": "Custom.Reference",
          "Value": "AGILEDEMO-34"
        },
        {
          "ReferenceName": "System.State",
          "Value": "New"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    },
    {
      "Author": "alexander.hjelm@solidify.dev",
      "Time": "2023-10-07T09:05:04.099+02:00",
      "Index": 1,
      "Fields": [
        {
          "ReferenceName": "System.AssignedTo",
          "Value": "alexander.hjelm@solidify.dev"
        },
        {
          "ReferenceName": "System.State",
          "Value": "Active"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    },
    {
      "Author": "alexander.hjelm@solidify.dev",
      "Time": "2023-10-07T09:05:10.141+02:00",
      "Index": 2,
      "Fields": [
        {
          "ReferenceName": "System.State",
          "Value": "Closed"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    },
    {
      "Author": "alexander.hjelm@solidify.dev",
      "Time": "2023-10-07T09:07:09.779+02:00",
      "Index": 3,
      "Fields": [
        {
          "ReferenceName": "System.State",
          "Value": "Active"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    }
  ]
}
Alexander-Hjelm commented 1 year ago

PR created with fix. Please try the feature branch and let me know the results!

Alexander-Hjelm commented 1 year ago

Merged #878. Reopen this issue if the problem exists.