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

azuredevops.getIteration

Explore with Pulumi AI

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

    Use this data source to access information about an existing Iteration (Sprint) within Azure DevOps.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        workItemTemplate: "Agile",
        versionControl: "Git",
        visibility: "private",
        description: "Managed by Terraform",
    });
    const example-root-iteration = azuredevops.getIterationOutput({
        projectId: example.id,
        path: "/",
        fetchChildren: true,
    });
    const example-child-iteration = azuredevops.getIterationOutput({
        projectId: example.id,
        path: "/Iteration 1",
        fetchChildren: true,
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        work_item_template="Agile",
        version_control="Git",
        visibility="private",
        description="Managed by Terraform")
    example_root_iteration = azuredevops.get_iteration_output(project_id=example.id,
        path="/",
        fetch_children=True)
    example_child_iteration = azuredevops.get_iteration_output(project_id=example.id,
        path="/Iteration 1",
        fetch_children=True)
    
    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 {
    		example, err := azuredevops.NewProject(ctx, "example", &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
    		}
    		_ = azuredevops.GetIterationOutput(ctx, azuredevops.GetIterationOutputArgs{
    			ProjectId:     example.ID(),
    			Path:          pulumi.String("/"),
    			FetchChildren: pulumi.Bool(true),
    		}, nil)
    		_ = azuredevops.GetIterationOutput(ctx, azuredevops.GetIterationOutputArgs{
    			ProjectId:     example.ID(),
    			Path:          pulumi.String("/Iteration 1"),
    			FetchChildren: pulumi.Bool(true),
    		}, nil)
    		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()
        {
            WorkItemTemplate = "Agile",
            VersionControl = "Git",
            Visibility = "private",
            Description = "Managed by Terraform",
        });
    
        var example_root_iteration = AzureDevOps.GetIteration.Invoke(new()
        {
            ProjectId = example.Id,
            Path = "/",
            FetchChildren = true,
        });
    
        var example_child_iteration = AzureDevOps.GetIteration.Invoke(new()
        {
            ProjectId = example.Id,
            Path = "/Iteration 1",
            FetchChildren = true,
        });
    
    });
    
    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.AzuredevopsFunctions;
    import com.pulumi.azuredevops.inputs.GetIterationArgs;
    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()        
                .workItemTemplate("Agile")
                .versionControl("Git")
                .visibility("private")
                .description("Managed by Terraform")
                .build());
    
            final var example-root-iteration = AzuredevopsFunctions.getIteration(GetIterationArgs.builder()
                .projectId(example.id())
                .path("/")
                .fetchChildren(true)
                .build());
    
            final var example-child-iteration = AzuredevopsFunctions.getIteration(GetIterationArgs.builder()
                .projectId(example.id())
                .path("/Iteration 1")
                .fetchChildren(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          workItemTemplate: Agile
          versionControl: Git
          visibility: private
          description: Managed by Terraform
    variables:
      example-root-iteration:
        fn::invoke:
          Function: azuredevops:getIteration
          Arguments:
            projectId: ${example.id}
            path: /
            fetchChildren: true
      example-child-iteration:
        fn::invoke:
          Function: azuredevops:getIteration
          Arguments:
            projectId: ${example.id}
            path: /Iteration 1
            fetchChildren: true
    

    PAT Permissions Required

    • Project & Team: vso.work - Grants the ability to read work items, queries, boards, area and iterations paths, and other work item tracking related metadata. Also grants the ability to execute queries, search work items and to receive notifications about work item events via service hooks.

    Using getIteration

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getIteration(args: GetIterationArgs, opts?: InvokeOptions): Promise<GetIterationResult>
    function getIterationOutput(args: GetIterationOutputArgs, opts?: InvokeOptions): Output<GetIterationResult>
    def get_iteration(fetch_children: Optional[bool] = None,
                      path: Optional[str] = None,
                      project_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetIterationResult
    def get_iteration_output(fetch_children: Optional[pulumi.Input[bool]] = None,
                      path: Optional[pulumi.Input[str]] = None,
                      project_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetIterationResult]
    func GetIteration(ctx *Context, args *GetIterationArgs, opts ...InvokeOption) (*GetIterationResult, error)
    func GetIterationOutput(ctx *Context, args *GetIterationOutputArgs, opts ...InvokeOption) GetIterationResultOutput

    > Note: This function is named GetIteration in the Go SDK.

    public static class GetIteration 
    {
        public static Task<GetIterationResult> InvokeAsync(GetIterationArgs args, InvokeOptions? opts = null)
        public static Output<GetIterationResult> Invoke(GetIterationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIterationResult> getIteration(GetIterationArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azuredevops:index/getIteration:getIteration
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The project ID.
    FetchChildren bool
    Read children nodes, Depth: 1, Default: true
    Path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    ProjectId string
    The project ID.
    FetchChildren bool
    Read children nodes, Depth: 1, Default: true
    Path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId String
    The project ID.
    fetchChildren Boolean
    Read children nodes, Depth: 1, Default: true
    path String
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId string
    The project ID.
    fetchChildren boolean
    Read children nodes, Depth: 1, Default: true
    path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    project_id str
    The project ID.
    fetch_children bool
    Read children nodes, Depth: 1, Default: true
    path str
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId String
    The project ID.
    fetchChildren Boolean
    Read children nodes, Depth: 1, Default: true
    path String
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned

    getIteration Result

    The following output properties are available:

    Childrens List<Pulumi.AzureDevOps.Outputs.GetIterationChildren>
    A list of children blocks as defined below, empty if has_children == false
    HasChildren bool
    Indicator if the child Iteration node has child nodes
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the child Iteration node
    Path string
    The complete path (in relative URL format) of the child Iteration
    ProjectId string
    The project ID of the child Iteration node
    FetchChildren bool
    Childrens []GetIterationChildren
    A list of children blocks as defined below, empty if has_children == false
    HasChildren bool
    Indicator if the child Iteration node has child nodes
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the child Iteration node
    Path string
    The complete path (in relative URL format) of the child Iteration
    ProjectId string
    The project ID of the child Iteration node
    FetchChildren bool
    childrens List<GetIterationChildren>
    A list of children blocks as defined below, empty if has_children == false
    hasChildren Boolean
    Indicator if the child Iteration node has child nodes
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the child Iteration node
    path String
    The complete path (in relative URL format) of the child Iteration
    projectId String
    The project ID of the child Iteration node
    fetchChildren Boolean
    childrens GetIterationChildren[]
    A list of children blocks as defined below, empty if has_children == false
    hasChildren boolean
    Indicator if the child Iteration node has child nodes
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the child Iteration node
    path string
    The complete path (in relative URL format) of the child Iteration
    projectId string
    The project ID of the child Iteration node
    fetchChildren boolean
    childrens Sequence[GetIterationChildren]
    A list of children blocks as defined below, empty if has_children == false
    has_children bool
    Indicator if the child Iteration node has child nodes
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the child Iteration node
    path str
    The complete path (in relative URL format) of the child Iteration
    project_id str
    The project ID of the child Iteration node
    fetch_children bool
    childrens List<Property Map>
    A list of children blocks as defined below, empty if has_children == false
    hasChildren Boolean
    Indicator if the child Iteration node has child nodes
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the child Iteration node
    path String
    The complete path (in relative URL format) of the child Iteration
    projectId String
    The project ID of the child Iteration node
    fetchChildren Boolean

    Supporting Types

    GetIterationChildren

    HasChildren bool
    Indicator if the child Iteration node has child nodes
    Id string
    The id of the child Iteration node
    Name string
    The name of the child Iteration node
    Path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    ProjectId string
    The project ID.
    HasChildren bool
    Indicator if the child Iteration node has child nodes
    Id string
    The id of the child Iteration node
    Name string
    The name of the child Iteration node
    Path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    ProjectId string
    The project ID.
    hasChildren Boolean
    Indicator if the child Iteration node has child nodes
    id String
    The id of the child Iteration node
    name String
    The name of the child Iteration node
    path String
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId String
    The project ID.
    hasChildren boolean
    Indicator if the child Iteration node has child nodes
    id string
    The id of the child Iteration node
    name string
    The name of the child Iteration node
    path string
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId string
    The project ID.
    has_children bool
    Indicator if the child Iteration node has child nodes
    id str
    The id of the child Iteration node
    name str
    The name of the child Iteration node
    path str
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    project_id str
    The project ID.
    hasChildren Boolean
    Indicator if the child Iteration node has child nodes
    id String
    The id of the child Iteration node
    name String
    The name of the child Iteration node
    path String
    The path to the Iteration, Format: URL relative; if omitted, or value "/" is used, the root Iteration will be returned
    projectId String
    The project ID.

    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