azuredevops.Workitem
Explore with Pulumi AI
Manages a Work Item in Azure Devops.
Example Usage
Basic usage
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";
const example = new azuredevops.Project("example", {
name: "Example Project",
workItemTemplate: "Agile",
versionControl: "Git",
visibility: "private",
description: "Managed by Terraform",
});
const exampleWorkitem = new azuredevops.Workitem("example", {
projectId: exampleAzuredevopsProject.id,
title: "Example Work Item",
type: "Issue",
state: "Active",
tags: ["Tag"],
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example",
name="Example Project",
work_item_template="Agile",
version_control="Git",
visibility="private",
description="Managed by Terraform")
example_workitem = azuredevops.Workitem("example",
project_id=example_azuredevops_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 {
_, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
Name: pulumi.String("Example Project"),
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, "example", &azuredevops.WorkitemArgs{
ProjectId: pulumi.Any(exampleAzuredevopsProject.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 example = new AzureDevOps.Project("example", new()
{
Name = "Example Project",
WorkItemTemplate = "Agile",
VersionControl = "Git",
Visibility = "private",
Description = "Managed by Terraform",
});
var exampleWorkitem = new AzureDevOps.Workitem("example", new()
{
ProjectId = exampleAzuredevopsProject.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 example = new Project("example", ProjectArgs.builder()
.name("Example Project")
.workItemTemplate("Agile")
.versionControl("Git")
.visibility("private")
.description("Managed by Terraform")
.build());
var exampleWorkitem = new Workitem("exampleWorkitem", WorkitemArgs.builder()
.projectId(exampleAzuredevopsProject.id())
.title("Example Work Item")
.type("Issue")
.state("Active")
.tags("Tag")
.build());
}
}
resources:
example:
type: azuredevops:Project
properties:
name: Example Project
workItemTemplate: Agile
versionControl: Git
visibility: private
description: Managed by Terraform
exampleWorkitem:
type: azuredevops:Workitem
name: example
properties:
projectId: ${exampleAzuredevopsProject.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 example = new azuredevops.Project("example", {
name: "Example Project",
workItemTemplate: "Agile",
versionControl: "Git",
visibility: "private",
description: "Managed by Terraform",
});
const exampleWorkitem = new azuredevops.Workitem("example", {
projectId: exampleAzuredevopsProject.id,
title: "Example Work Item",
type: "Issue",
state: "Active",
tags: ["Tag"],
customFields: {
example: "example",
},
});
import pulumi
import pulumi_azuredevops as azuredevops
example = azuredevops.Project("example",
name="Example Project",
work_item_template="Agile",
version_control="Git",
visibility="private",
description="Managed by Terraform")
example_workitem = azuredevops.Workitem("example",
project_id=example_azuredevops_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 {
_, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
Name: pulumi.String("Example Project"),
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, "example", &azuredevops.WorkitemArgs{
ProjectId: pulumi.Any(exampleAzuredevopsProject.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 example = new AzureDevOps.Project("example", new()
{
Name = "Example Project",
WorkItemTemplate = "Agile",
VersionControl = "Git",
Visibility = "private",
Description = "Managed by Terraform",
});
var exampleWorkitem = new AzureDevOps.Workitem("example", new()
{
ProjectId = exampleAzuredevopsProject.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 example = new Project("example", ProjectArgs.builder()
.name("Example Project")
.workItemTemplate("Agile")
.versionControl("Git")
.visibility("private")
.description("Managed by Terraform")
.build());
var exampleWorkitem = new Workitem("exampleWorkitem", WorkitemArgs.builder()
.projectId(exampleAzuredevopsProject.id())
.title("Example Work Item")
.type("Issue")
.state("Active")
.tags("Tag")
.customFields(Map.of("example", "example"))
.build());
}
}
resources:
example:
type: azuredevops:Project
properties:
name: Example Project
workItemTemplate: Agile
versionControl: Git
visibility: private
description: Managed by Terraform
exampleWorkitem:
type: azuredevops:Workitem
name: example
properties:
projectId: ${exampleAzuredevopsProject.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.
Constructor 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:
- Project
Id 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. - Area
Path string - Specifies the area where the Work Item is used.
- Custom
Fields Dictionary<string, string> - Specifies a list with Custom Fields for the Work Item.
- Iteration
Path 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - List<string>
- Specifies a list of Tags.
- Project
Id 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. - Area
Path string - Specifies the area where the Work Item is used.
- Custom
Fields map[string]string - Specifies a list with Custom Fields for the Work Item.
- Iteration
Path 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - []string
- Specifies a list of Tags.
- project
Id 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. - area
Path String - Specifies the area where the Work Item is used.
- custom
Fields Map<String,String> - Specifies a list with Custom Fields for the Work Item.
- iteration
Path 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - List<String>
- Specifies a list of Tags.
- project
Id 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. - area
Path string - Specifies the area where the Work Item is used.
- custom
Fields {[key: string]: string} - Specifies a list with Custom Fields for the Work Item.
- iteration
Path 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - Sequence[str]
- Specifies a list of Tags.
- project
Id 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. - area
Path String - Specifies the area where the Work Item is used.
- custom
Fields Map<String> - Specifies a list with Custom Fields for the Work Item.
- iteration
Path 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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.
- Area
Path string - Specifies the area where the Work Item is used.
- Custom
Fields Dictionary<string, string> - Specifies a list with Custom Fields for the Work Item.
- Iteration
Path string - Specifies the iteration in which the Work Item is used.
- Project
Id 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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.
- Area
Path string - Specifies the area where the Work Item is used.
- Custom
Fields map[string]string - Specifies a list with Custom Fields for the Work Item.
- Iteration
Path string - Specifies the iteration in which the Work Item is used.
- Project
Id 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - []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 String - Specifies the area where the Work Item is used.
- custom
Fields Map<String,String> - Specifies a list with Custom Fields for the Work Item.
- iteration
Path String - Specifies the iteration in which the Work Item is used.
- project
Id 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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.
- area
Path string - Specifies the area where the Work Item is used.
- custom
Fields {[key: string]: string} - Specifies a list with Custom Fields for the Work Item.
- iteration
Path string - Specifies the iteration in which the Work Item is used.
- project
Id 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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.
- area
Path String - Specifies the area where the Work Item is used.
- custom
Fields Map<String> - Specifies a list with Custom Fields for the Work Item.
- iteration
Path String - Specifies the iteration in which the Work Item is used.
- project
Id 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
) areNew
,Active
,Resolved
, andClosed
. See Workflow states for more details. - 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.