Azure DevOps v3.1.1 published on Monday, May 20, 2024 by Pulumi
azuredevops.getIteration
Explore with Pulumi AI
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", {
name: "Example Project",
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",
name="Example Project",
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{
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
}
_ = 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()
{
Name = "Example Project",
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()
.name("Example Project")
.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:
name: Example Project
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
Relevant Links
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:
- Project
Id string - The project ID.
- Fetch
Children 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
- Project
Id string - The project ID.
- Fetch
Children 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
- project
Id String - The project ID.
- fetch
Children 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 string - The project ID.
- fetch
Children 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
- project
Id String - The project ID.
- fetch
Children 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.
Azure Dev Ops. Outputs. Get Iteration Children> - A list of
children
blocks as defined below, empty ifhas_children == false
- Has
Children 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
- Project
Id string - The project ID of the child Iteration node
- Fetch
Children bool
- Childrens
[]Get
Iteration Children - A list of
children
blocks as defined below, empty ifhas_children == false
- Has
Children 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
- Project
Id string - The project ID of the child Iteration node
- Fetch
Children bool
- childrens
List<Get
Iteration Children> - A list of
children
blocks as defined below, empty ifhas_children == false
- has
Children 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
- project
Id String - The project ID of the child Iteration node
- fetch
Children Boolean
- childrens
Get
Iteration Children[] - A list of
children
blocks as defined below, empty ifhas_children == false
- has
Children 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
- project
Id string - The project ID of the child Iteration node
- fetch
Children boolean
- childrens
Sequence[Get
Iteration Children] - A list of
children
blocks as defined below, empty ifhas_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 ifhas_children == false
- has
Children 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
- project
Id String - The project ID of the child Iteration node
- fetch
Children Boolean
Supporting Types
GetIterationChildren
- Has
Children 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 - Project
Id string - The project ID.
- Has
Children 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 - Project
Id string - The project ID.
- has
Children 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 - project
Id String - The project ID.
- has
Children 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 - project
Id 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.
- has
Children 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 - project
Id 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.