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

TF26027: A field definition Microsoft.VSTS.Common.ClosedDate in the work item type definition file does not exist. #2455

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

MrHinsh
Copy link
Member

@MrHinsh MrHinsh commented Oct 22, 2024

Some work items do not have this field...

Updated to:

if (newWorkItem.Fields.Contains("Microsoft.VSTS.Common.ClosedDate") && newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].IsEditable)
{
    newWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value = oldWorkItem.Fields["Microsoft.VSTS.Common.ClosedDate"].Value;
}

Related Disucssions:

…efore accessing 'ClosedDate'

The code now checks if the "Microsoft.VSTS.Common.ClosedDate" field exists before attempting to access it. This prevents potential runtime errors when the field is not present in the work item, ensuring more robust and error-free execution.
@nkdagility-actions-bot
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://blue-river-093197403-2455.westeurope.5.azurestaticapps.net

@MrHinsh MrHinsh merged commit 6a6e0e2 into main Oct 22, 2024
12 checks passed
@MrHinsh MrHinsh deleted the topic/ClosedDate-Fix-When-Not-Exist branch October 22, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant