Como adicionar um anexo a uma história de usuário usando o REST .NET do Rally

Estamos no processo de portar nosso código .NET Rally do SOAP para a API .NET REST. Até aí tudo bem, a API REST parece ser mais rápida e mais fácil de usar, já que não há nenhum WSDL para quebrar a cada vez que os campos personalizados do produto de trabalho são alterados no Espaço de Trabalho do Rally.

Estou tendo problemas com uma coisa, enquanto tentamos replicar a capacidade de fazer upload de anexos. Estamos seguindo um procedimento muito semelhante ao descrito neste post:

Rally SOAP API - Como adiciono um anexo a um requisito hierárquico

Por onde a imagem é lida em um System.Drawing.Image. Usamos a função ImageToByteArray para converter a imagem em uma matriz de bytes que depois é atribuída ao AttachmentContent, que é criado primeiro.

Em seguida, o anexo é criado e conectado ao AttachmentContent e ao HierarchicalRequirement.

Todos os eventos de criação funcionam muito bem. O objeto de conteúdo é criado bem. Em seguida, o novo anexo chamado "Image.png" é criado e vinculado à história. Mas quando eu baixar o anexo resultante do Rally, Image.png tem zero bytes! Eu tentei isso com imagens diferentes, JPEG, PNG, etc, todos com os mesmos resultados.

Um trecho do código que mostra nosso processo está incluído abaixo. Existe algo óbvio que estou perdendo? Desde já, obrigado.

    // .... Read content into a System.Drawing.Image called imageObject ....

    // Convert Image to byte array
    byte[] imageBytes = ImageToByteArray(imageObject, System.Drawing.Imaging.ImageFormat.Png);
    var imageLength = imageBytes.Length;

    // AttachmentContent
    DynamicJsonObject attachmentContent = new DynamicJsonObject();
    attachmentContent["Content"] = imageBytes ;

    CreateResult cr = restApi.Create("AttachmentContent", myAttachmentContent);
    String contentRef = cr.Reference;
    Console.WriteLine("Created: " + contentRef);

    // Set up attachment
    DynamicJsonObject newAttachment = new DynamicJsonObject();
    newAttachment["Artifact"] = story;
    newAttachment["Content"] = attachmentContent;
    newAttachment["Name"] = "Image.png";
    newAttachment["ContentType"] = "image/png";
    newAttachment["Size"] = imageLength;
    newAttachment["User"] = user;


    // Create the attachment in Rally
    cr = restApi.Create("Attachment", newAttachment);

    String attachRef = cr.Reference;
    Console.WriteLine("Created: " + attachRef);

}

public static byte[] ImageToByteArray(Image image, System.Drawing.Imaging.ImageFormat format)
{
    using (MemoryStream ms = new MemoryStream())
    {
        image.Save(ms, format);

        // Convert Image to byte[]                
        byte[] imageBytes = ms.ToArray();
        return imageBytes;
    }
}

questionAnswers(1)

yourAnswerToTheQuestion