Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
csaket opened this issue Jun 22, 2023 · 19 comments · Fixed by #812 or #878
Closed

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

csaket opened this issue Jun 22, 2023 · 19 comments · Fixed by #812 or #878
Assignees
Labels
bug Something isn't working

Comments

@csaket
Copy link

csaket commented Jun 22, 2023

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
Copy link
Collaborator

Alexander-Hjelm commented Jun 28, 2023

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
Copy link

jus062 commented Jun 29, 2023

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
Copy link
Collaborator

Strange, because it works just fine in our tests.

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

@jus062
Copy link

jus062 commented Jun 29, 2023

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

@jus062
Copy link

jus062 commented Jun 29, 2023

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
Copy link
Collaborator

Alexander-Hjelm commented Jun 29, 2023

Ok! marking as bug

@Alexander-Hjelm Alexander-Hjelm added bug Something isn't working and removed support labels Jun 29, 2023
@RoyalWulf
Copy link

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
Copy link

UweStein commented Jul 7, 2023

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
Copy link
Collaborator

@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
Copy link
Collaborator

Alexander-Hjelm commented Jul 23, 2023

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

@RoyalWulf
Copy link

RoyalWulf commented Aug 5, 2023 via email

@Alexander-Hjelm
Copy link
Collaborator

@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
Copy link
Collaborator

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

@eplnde
Copy link

eplnde commented Aug 15, 2023

@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
Copy link
Collaborator

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

@surendra-github
Copy link

Thank you so much !!

@Alexander-Hjelm
Copy link
Collaborator

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": "[email protected]",
      "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": "[email protected]",
      "Time": "2023-10-07T09:05:04.099+02:00",
      "Index": 1,
      "Fields": [
        {
          "ReferenceName": "System.AssignedTo",
          "Value": "[email protected]"
        },
        {
          "ReferenceName": "System.State",
          "Value": "Active"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    },
    {
      "Author": "[email protected]",
      "Time": "2023-10-07T09:05:10.141+02:00",
      "Index": 2,
      "Fields": [
        {
          "ReferenceName": "System.State",
          "Value": "Closed"
        }
      ],
      "Links": [],
      "Attachments": [],
      "Commit": null,
      "AttachmentReferences": false
    },
    {
      "Author": "[email protected]",
      "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
Copy link
Collaborator

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

@Alexander-Hjelm
Copy link
Collaborator

Alexander-Hjelm commented Oct 9, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
7 participants