microsoft / terraform-provider-azuredevops

Terraform Azure DevOps provider
https://www.terraform.io/docs/providers/azuredevops/
MIT License
379 stars 270 forks source link

Add Work Item Resource #660

Open IronMania opened 1 year ago

IronMania commented 1 year ago

Community Note

Description

I want to track workitems for an Azure Devops project with Terraform.

New or Affected Resource(s)

Potential Terraform Configuration

resource "azuredevops_workitem" "example" {
  title = "Testing Terraform with"
  project = "9a6ec7fd-a679-4b11-af60-0b1fc8cae540"
  type = "Issue"
  custom_fields = {
    foo = "SomeCustomField"
  } 
  state = "To Do"
  tags = ["tag1"]
}

References

I created a pull request https://github.com/microsoft/terraform-provider-azuredevops/pull/659

IronMania commented 1 year ago

I am thinking. Could it be better to have a desired state for a ticket? This way one could track that the ticket is correctly created, when it is done as example.

In our case we have a ticket workflow and I want to create a ticket and I want that the Ticket went to done. So that the read is only accepting it as complete when desired value matches the actual state of the Ticket. Something like this:

resource "azuredevops_workitem" "example" {
  title = "Testing Terraform with"
  project = "9a6ec7fd-a679-4b11-af60-0b1fc8cae540"
  type = "Issue"
  custom_fields = {
    foo = "SomeCustomField"
  } 
 state = {
     value = "To Do"
     desired = true
    }
}

What do you think about this?

taljundi commented 1 year ago

How can you add a description to the workItem?

IronMania commented 1 year ago

actually you can't not implemented. but should be easy to implement