GithubHelp home page GithubHelp logo

pathakrohit08 / azuredevopscustomobjects Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeremylindsayni/azuredevopscustomobjects

0.0 2.0 0.0 62 KB

Experimental package to assist with creation of work items in Azure DevOps boards using .NET.

Home Page: https://jeremylindsayni.wordpress.com/2019/01/07/bulk-load-your-work-items-into-azure-devops-boards-from-another-issue-tracking-system/

License: MIT License

C# 100.00%

azuredevopscustomobjects's Introduction

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);
        }
    }
}

azuredevopscustomobjects's People

Contributors

jeremylindsayni avatar

Watchers

James Cloos avatar Rohit Pathak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.