AzureDevOpsCustomObjects
Experimental package to assist with creation of work items in Azure DevOps boards using .NET.
Install / Use
/learn @jeremylindsayni/AzureDevOpsCustomObjectsREADME
Azure DevOps Custom Objects
Experimental package to assist with creation of work items in Azure DevOps boards using .NET.
This project targets the .NET Framework, not .NET Standard.
Install the package from NuGet:
Install-Package Microsoft.TeamFoundationServer.Client
Install-Package Microsoft.VisualStudio.Services.Client
Install-Package AzureDevOpsBoardsCustomWorkItemObjects -pre
Example use in a .NET Framework project
The code below shows how to add a bug.
using System.Collections.Generic;
using AzureDevOpsCustomObjects;
using AzureDevOpsCustomObjects.Enumerations;
using AzureDevOpsCustomObjects.WorkItems;
namespace ConsoleApp
{
internal static class Program
{
private static void Main(string[] args)
{
const string uri = "https://dev.azure.com/jeremylindsay";
const string personalAccessToken = "[[***my personal access token***]]";
const string projectName = "Corvette";
var workItemCreator = new WorkItemCreator(uri, personalAccessToken, projectName);
// hardcoded here as an example, but this could be populated any way you want
// e.g. from a database, or from parsing a CSV
var bug = new AzureDevOpsBug
{
Title = "This is the new title",
ReproSteps = "Log in.",
Priority = AzureDevOpsWorkItemPriority.Medium,
Severity = AzureDevOpsWorkItemSeverity.Low,
AssignedTo = "Jeremy Lindsay",
Activity = "Development",
AcceptanceCriteria = "This is the acceptance criteria",
SystemInformation = "This is the system information",
Effort = 13,
Tag = "Cosmetic; UI Only",
Comments = new List<AzureDevOpsWorkItemComment>
{
new AzureDevOpsWorkItemComment
{
OrderingId = 1, Text = "New Comment from product owner."
},
new AzureDevOpsWorkItemComment
{
OrderingId = 2, Text = "Another Comment from product owner."
}
},
Attachments = new List<AzureDevOpsWorkItemAttachment>
{
new AzureDevOpsWorkItemAttachment
{
OrderingId = 1,
AttachmentPath = @"C:\Users\jeremy.lindsay\Desktop\TextFile.txt",
Comment = "This is my uploaded text file."
},
new AzureDevOpsWorkItemAttachment
{
OrderingId = 2,
AttachmentPath = @"C:\Users\jeremy.lindsay\Desktop\ImageFile.png",
Comment = "This is my uploaded image file."
}
}
};
workItemCreator.Create(bug);
}
}
}
You can also add any missing fields, as shown in the code below which is an example of how to add a task.
using AzureDevOpsCustomObjects;
using Microsoft.VisualStudio.Services.WebApi.Patch.Json;
namespace ConsoleApp
{
internal static class Program
{
private static void Main(string[] args)
{
const string uri = "https://dev.azure.com/jeremylindsay";
const string personalAccessToken = "[[***my personal access token***]]";
const string projectName = "Corvette";
var workItemCreator = new WorkItemCreator(uri, personalAccessToken, projectName);
var productBacklogItem = new AzureDevOpsProductBacklogItem
{
Title = "Add reports for how many users log in each day",
Description = "Need a new report with log in statistics.",
Priority = AzureDevOpsWorkItemPriority.Low,
Severity = AzureDevOpsWorkItemSeverity.Low,
AssignedTo = "Jeremy Lindsay",
Activity = "Development",
AcceptanceCriteria = "This is the acceptance criteria",
SystemInformation = "This is the system information",
Effort = 13,
Tag = "Reporting; Users"
};
productBacklogItem.Add(
new JsonPatchOperation
{
Path = "/fields/System.History",
Value = "Comment from product owner."
}
);
var createdBacklogItem = workItemCreator.Create(productBacklogItem);
}
}
}
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
