File: createWorkitemsInBulk.md

package info (click to toggle)
azure-devops-cli-extension 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 22,680 kB
  • sloc: python: 160,797; xml: 198; sh: 61; makefile: 56
file content (61 lines) | stat: -rw-r--r-- 1,857 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Creating work items in bulk

## When to use

You can create large number of workitems through a text file input or interactively. Common use case is when planning a project or bug bash.

## How to use

### Interactive Mode

Just invoke the script and answer the questions to use the default organization, project and workitem type.

```
> .\createWorkitemsInBulk.ps1

Sample Usage -
createWorkitemsinBulk.ps1 -workitem_titles ./my_wit_titles -wit_template ./my_wit_template

Template not provided will ask for default params interactively. Alternatively create a wit template and pass it to the script.

Organization URL: : https://dev.azure.com/baggaatul24
Project Name: : deletetest
Workitem Type: : Task
```

You will be prompted for workitem titles and keep creating new items as you press enter. Press Ctrl+C to break.

```
No file for workitem titles. Will run in interactive mode to create workitems.

Enter workitem title: : Test issue 1 - XYZ not working
ID    Type    Title                           Assigned To    State
----  ------  ------------------------------  -------------  -------
106   Task    Test issue 1 - XYZ not working                 New

Enter workitem title: :
```

### Script Mode

1. Create a file with workitem titles in different lines e.g. my_wit_title.txt has content-

    ```
    XYZ is not working
    Service enhancement - add caching logic
    Fix the issue in caching
    ```

1. Create a file with template for default organization and project to be used when creating workitems. e.g. my_wit_template.txt has content-

    ```
    organization=https://dev.azure.com/ContosoOrg
    project=ContosoProject
    workitem_type=Bug
    ```

1. Invoke the Script with the template and titles files as follows-

```
.\createWorkitemsInBulk.ps1 -workitem_titles .\my_wit_titles.txt -wit_template .\my_wit_template.txt
```