1. Packages
  2. AzureDevOps
  3. API Docs
  4. Workitem
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

azuredevops.Workitem

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi

    Manages a Work Item in Azure Devops.

    Example Usage

    Basic usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const exampleProject = new azuredevops.Project("exampleProject", {
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const exampleWorkitem = new azuredevops.Workitem("exampleWorkitem", {
        projectId: exampleProject.id,
        title: "Example Work Item",
        type: "Issue",
        state: "Active",
        tags: ["Tag"],
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.Project("exampleProject",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_workitem = azuredevops.Workitem("exampleWorkitem",
        project_id=example_project.id,
        title="Example Work Item",
        type="Issue",
        state="Active",
        tags=["Tag"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewWorkitem(ctx, "exampleWorkitem", &azuredevops.WorkitemArgs{
    			ProjectId: exampleProject.ID(),
    			Title:     pulumi.String("Example Work Item"),
    			Type:      pulumi.String("Issue"),
    			State:     pulumi.String("Active"),
    			Tags: pulumi.StringArray{
    				pulumi.String("Tag"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new AzureDevOps.Project("exampleProject", new()
        {
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var exampleWorkitem = new AzureDevOps.Workitem("exampleWorkitem", new()
        {
            ProjectId = exampleProject.Id,
            Title = "Example Work Item",
            Type = "Issue",
            State = "Active",
            Tags = new[]
            {
                "Tag",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.Workitem;
    import com.pulumi.azuredevops.WorkitemArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()        
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            var exampleWorkitem = new Workitem("exampleWorkitem", WorkitemArgs.builder()        
                .projectId(exampleProject.id())
                .title("Example Work Item")
                .type("Issue")
                .state("Active")
                .tags("Tag")
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        properties:
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
      exampleWorkitem:
        type: azuredevops:Workitem
        properties:
          projectId: ${exampleProject.id}
          title: Example Work Item
          type: Issue
          state: Active
          tags:
            - Tag
    

    With custom fields

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const exampleProject = new azuredevops.Project("exampleProject", {
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const exampleWorkitem = new azuredevops.Workitem("exampleWorkitem", {
        projectId: exampleProject.id,
        title: "Example Work Item",
        type: "Issue",
        state: "Active",
        tags: ["Tag"],
        customFields: {
            example: "example",
        },
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example_project = azuredevops.Project("exampleProject",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_workitem = azuredevops.Workitem("exampleWorkitem",
        project_id=example_project.id,
        title="Example Work Item",
        type="Issue",
        state="Active",
        tags=["Tag"],
        custom_fields={
            "example": "example",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
    			WorkItemTemplate: pulumi.String("Agile"),
    			VersionControl:   pulumi.String("Git"),
    			Visibility:       pulumi.String("private"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewWorkitem(ctx, "exampleWorkitem", &azuredevops.WorkitemArgs{
    			ProjectId: exampleProject.ID(),
    			Title:     pulumi.String("Example Work Item"),
    			Type:      pulumi.String("Issue"),
    			State:     pulumi.String("Active"),
    			Tags: pulumi.StringArray{
    				pulumi.String("Tag"),
    			},
    			CustomFields: pulumi.StringMap{
    				"example": pulumi.String("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = new AzureDevOps.Project("exampleProject", new()
        {
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var exampleWorkitem = new AzureDevOps.Workitem("exampleWorkitem", new()
        {
            ProjectId = exampleProject.Id,
            Title = "Example Work Item",
            Type = "Issue",
            State = "Active",
            Tags = new[]
            {
                "Tag",
            },
            CustomFields = 
            {
                { "example", "example" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.Workitem;
    import com.pulumi.azuredevops.WorkitemArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleProject = new Project("exampleProject", ProjectArgs.builder()        
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            var exampleWorkitem = new Workitem("exampleWorkitem", WorkitemArgs.builder()        
                .projectId(exampleProject.id())
                .title("Example Work Item")
                .type("Issue")
                .state("Active")
                .tags("Tag")
                .customFields(Map.of("example", "example"))
                .build());
    
        }
    }
    
    resources:
      exampleProject:
        type: azuredevops:Project
        properties:
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
      exampleWorkitem:
        type: azuredevops:Workitem
        properties:
          projectId: ${exampleProject.id}
          title: Example Work Item
          type: Issue
          state: Active
          tags:
            - Tag
          customFields:
            example: example
    

    Create Workitem Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Workitem(name: string, args: WorkitemArgs, opts?: CustomResourceOptions);
    @overload
    def Workitem(resource_name: str,
                 args: WorkitemArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def Workitem(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 project_id: Optional[str] = None,
                 title: Optional[str] = None,
                 type: Optional[str] = None,
                 area_path: Optional[str] = None,
                 custom_fields: Optional[Mapping[str, str]] = None,
                 iteration_path: Optional[str] = None,
                 state: Optional[str] = None,
                 tags: Optional[Sequence[str]] = None)
    func NewWorkitem(ctx *Context, name string, args WorkitemArgs, opts ...ResourceOption) (*Workitem, error)
    public Workitem(string name, WorkitemArgs args, CustomResourceOptions? opts = null)
    public Workitem(String name, WorkitemArgs args)
    public Workitem(String name, WorkitemArgs args, CustomResourceOptions options)
    
    type: azuredevops:Workitem
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args WorkitemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args WorkitemArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args WorkitemArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkitemArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkitemArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var workitemResource = new AzureDevOps.Workitem("workitemResource", new()
    {
        ProjectId = "string",
        Title = "string",
        Type = "string",
        AreaPath = "string",
        CustomFields = 
        {
            { "string", "string" },
        },
        IterationPath = "string",
        State = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := azuredevops.NewWorkitem(ctx, "workitemResource", &azuredevops.WorkitemArgs{
    	ProjectId: pulumi.String("string"),
    	Title:     pulumi.String("string"),
    	Type:      pulumi.String("string"),
    	AreaPath:  pulumi.String("string"),
    	CustomFields: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	IterationPath: pulumi.String("string"),
    	State:         pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var workitemResource = new Workitem("workitemResource", WorkitemArgs.builder()        
        .projectId("string")
        .title("string")
        .type("string")
        .areaPath("string")
        .customFields(Map.of("string", "string"))
        .iterationPath("string")
        .state("string")
        .tags("string")
        .build());
    
    workitem_resource = azuredevops.Workitem("workitemResource",
        project_id="string",
        title="string",
        type="string",
        area_path="string",
        custom_fields={
            "string": "string",
        },
        iteration_path="string",
        state="string",
        tags=["string"])
    
    const workitemResource = new azuredevops.Workitem("workitemResource", {
        projectId: "string",
        title: "string",
        type: "string",
        areaPath: "string",
        customFields: {
            string: "string",
        },
        iterationPath: "string",
        state: "string",
        tags: ["string"],
    });
    
    type: azuredevops:Workitem
    properties:
        areaPath: string
        customFields:
            string: string
        iterationPath: string
        projectId: string
        state: string
        tags:
            - string
        title: string
        type: string
    

    Workitem Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The Workitem resource accepts the following input properties:

    ProjectId string
    The ID of the Project.
    Title string
    The Title of the Work Item.
    Type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    AreaPath string
    Specifies the area where the Work Item is used.
    CustomFields Dictionary<string, string>
    Specifies a list with Custom Fields for the Work Item.
    IterationPath string
    Specifies the iteration in which the Work Item is used.
    State string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    Tags List<string>
    Specifies a list of Tags.
    ProjectId string
    The ID of the Project.
    Title string
    The Title of the Work Item.
    Type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    AreaPath string
    Specifies the area where the Work Item is used.
    CustomFields map[string]string
    Specifies a list with Custom Fields for the Work Item.
    IterationPath string
    Specifies the iteration in which the Work Item is used.
    State string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    Tags []string
    Specifies a list of Tags.
    projectId String
    The ID of the Project.
    title String
    The Title of the Work Item.
    type String
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath String
    Specifies the area where the Work Item is used.
    customFields Map<String,String>
    Specifies a list with Custom Fields for the Work Item.
    iterationPath String
    Specifies the iteration in which the Work Item is used.
    state String
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags List<String>
    Specifies a list of Tags.
    projectId string
    The ID of the Project.
    title string
    The Title of the Work Item.
    type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath string
    Specifies the area where the Work Item is used.
    customFields {[key: string]: string}
    Specifies a list with Custom Fields for the Work Item.
    iterationPath string
    Specifies the iteration in which the Work Item is used.
    state string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags string[]
    Specifies a list of Tags.
    project_id str
    The ID of the Project.
    title str
    The Title of the Work Item.
    type str
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    area_path str
    Specifies the area where the Work Item is used.
    custom_fields Mapping[str, str]
    Specifies a list with Custom Fields for the Work Item.
    iteration_path str
    Specifies the iteration in which the Work Item is used.
    state str
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags Sequence[str]
    Specifies a list of Tags.
    projectId String
    The ID of the Project.
    title String
    The Title of the Work Item.
    type String
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath String
    Specifies the area where the Work Item is used.
    customFields Map<String>
    Specifies a list with Custom Fields for the Work Item.
    iterationPath String
    Specifies the iteration in which the Work Item is used.
    state String
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags List<String>
    Specifies a list of Tags.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Workitem resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing Workitem Resource

    Get an existing Workitem resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: WorkitemState, opts?: CustomResourceOptions): Workitem
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            area_path: Optional[str] = None,
            custom_fields: Optional[Mapping[str, str]] = None,
            iteration_path: Optional[str] = None,
            project_id: Optional[str] = None,
            state: Optional[str] = None,
            tags: Optional[Sequence[str]] = None,
            title: Optional[str] = None,
            type: Optional[str] = None) -> Workitem
    func GetWorkitem(ctx *Context, name string, id IDInput, state *WorkitemState, opts ...ResourceOption) (*Workitem, error)
    public static Workitem Get(string name, Input<string> id, WorkitemState? state, CustomResourceOptions? opts = null)
    public static Workitem get(String name, Output<String> id, WorkitemState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AreaPath string
    Specifies the area where the Work Item is used.
    CustomFields Dictionary<string, string>
    Specifies a list with Custom Fields for the Work Item.
    IterationPath string
    Specifies the iteration in which the Work Item is used.
    ProjectId string
    The ID of the Project.
    State string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    Tags List<string>
    Specifies a list of Tags.
    Title string
    The Title of the Work Item.
    Type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    AreaPath string
    Specifies the area where the Work Item is used.
    CustomFields map[string]string
    Specifies a list with Custom Fields for the Work Item.
    IterationPath string
    Specifies the iteration in which the Work Item is used.
    ProjectId string
    The ID of the Project.
    State string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    Tags []string
    Specifies a list of Tags.
    Title string
    The Title of the Work Item.
    Type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath String
    Specifies the area where the Work Item is used.
    customFields Map<String,String>
    Specifies a list with Custom Fields for the Work Item.
    iterationPath String
    Specifies the iteration in which the Work Item is used.
    projectId String
    The ID of the Project.
    state String
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags List<String>
    Specifies a list of Tags.
    title String
    The Title of the Work Item.
    type String
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath string
    Specifies the area where the Work Item is used.
    customFields {[key: string]: string}
    Specifies a list with Custom Fields for the Work Item.
    iterationPath string
    Specifies the iteration in which the Work Item is used.
    projectId string
    The ID of the Project.
    state string
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags string[]
    Specifies a list of Tags.
    title string
    The Title of the Work Item.
    type string
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    area_path str
    Specifies the area where the Work Item is used.
    custom_fields Mapping[str, str]
    Specifies a list with Custom Fields for the Work Item.
    iteration_path str
    Specifies the iteration in which the Work Item is used.
    project_id str
    The ID of the Project.
    state str
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags Sequence[str]
    Specifies a list of Tags.
    title str
    The Title of the Work Item.
    type str
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.
    areaPath String
    Specifies the area where the Work Item is used.
    customFields Map<String>
    Specifies a list with Custom Fields for the Work Item.
    iterationPath String
    Specifies the iteration in which the Work Item is used.
    projectId String
    The ID of the Project.
    state String
    The state of the Work Item. The four main states that are defined for the User Story (Agile) are New, Active, Resolved, and Closed. See Workflow states for more details.
    tags List<String>
    Specifies a list of Tags.
    title String
    The Title of the Work Item.
    type String
    The Type of the Work Item. The work item type varies depending on the process used when creating the project(Agile, Basic, Scrum, Scrum). See Work Item Types for more details.

    Import

    Work Item resource does not support import.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.0.0 published on Friday, Mar 15, 2024 by Pulumi