Skip to content

Investigate if we can/should handle Attachment links/Work Item links in a more general fashion #1064

Open
@Alexander-Hjelm

Description

@Alexander-Hjelm

Following up on #1063

Here is the CorrectDescription method for reference:

public bool CorrectDescription(WorkItem wi, WiItem wiItem, WiRevision rev, IsAttachmentMigratedDelegate<string, string, bool> isAttachmentMigratedDelegate)
{
if (wi == null)
{
throw new ArgumentException(nameof(wi));
}
if (wiItem == null)
{
throw new ArgumentException(nameof(wiItem));
}
if (rev == null)
{
throw new ArgumentException(nameof(rev));
}
string description = wi.Fields[WiFieldReference.WorkItemType].ToString() == "Bug" ? wi.Fields[WiFieldReference.ReproSteps].ToString() : wi.Fields[WiFieldReference.Description].ToString();
if (string.IsNullOrWhiteSpace(description))
return false;
bool descUpdated = false;
CorrectImagePath(wi, wiItem, rev, ref description, ref descUpdated, isAttachmentMigratedDelegate);
if (descUpdated)
{
if (wi.Fields[WiFieldReference.WorkItemType].ToString() == "Bug")
{
wi.Fields[WiFieldReference.ReproSteps] = description;
}
else
{
wi.Fields[WiFieldReference.Description] = description;
}
}
return descUpdated;
}

You can see that the description field seems to be hard coded for various Work Item Types. If the WI Type name is "Bug", then it seems to switch over to using ReproSteps instead of Description. This causes issues if there are any other HTML fields than Description/Bug. Is there an existing way to handle custom HTML fields, or does this feature need to be built?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions