-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
95 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,107 @@ | ||
# abb-workitem-clone | ||
|
||
# Pipeline Specification | ||
|
||
## Pipeline Configuration and Initialization | ||
This pipeline enhances the setup process for customer projects within ADO by automating the collection of essential information and creating work items. Initially, it requests key details as follows: | ||
- **Project Origin:** Define the area path for project generation, for example, "ABB Traction\Engineering Group\ECH Group." | ||
- **Project Identification:** Input the ABB Project ID (4 digits) along with the name of the customer project, for example, "1234 MyNewCustomerProject." | ||
- **Target Work Item ID:** Specify the ID of the "Project" work item within the "ABB Traction" ADO project, which will act as the parent for newly created work items. | ||
## Commands | ||
|
||
Additionally, a JSON configuration file shall be provided by the user, containing vital data for action execution: | ||
- IDs of work items to be copied from the "ABB Traction Template" ADO project. | ||
- Node Name for each work item, such as Power, Control, or Mechanics. | ||
- Tags for each work item, separated by semicolons. | ||
- Fields to be updated for each work item. | ||
- Titles for each work item. | ||
### `clone` | ||
|
||
## Automated Actions | ||
Upon initialization, the pipeline performs the following actions: | ||
Clones work items from a template project to a target project incorproating a JSON configuration file specificyng what work items to create and how to update them. | ||
|
||
1. **Pre-copy Validation:** | ||
- Verifies that the Target Work Item ID is of the work item type "Project." | ||
- Reviews relationships among work items in the "ABB Traction Template" to identify any non-replicable ones in the "ABB Traction" project due to missing items in the JSON file or outdated relationships. | ||
- Displays a warning about these relationships and requests user confirmation to proceed. | ||
- Confirms the existence of the specified area path in the "ABB Traction" ADO project for all new work items, based on provided Node Names and the Project Origin. The entire area path is the Project Origin + Node Name. | ||
- Indicates assigned Area Paths per Node Name. | ||
- If an Area Path is missing, it displays available areas in the target project for user selection. | ||
- `--outputPath`` - The path to the output folder. Default is `.\`. | ||
- `--jsonFile` - The path to the JSON configuration file. | ||
- `--templateAccessToken` - The access token for the template project. | ||
- `--config` - The path to the configuration file. Default is `.\configuration.json`. | ||
- `--targetAccessToken` - The access token for the target project. | ||
- `--projectId` - The ID of the project to clone work items to. | ||
- `--NonInteractive` - Disables interactive mode. Default is `false`. | ||
- `--ClearCache` - Clears the cache. Default is `false`. | ||
|
||
2. **Template Duplication:** | ||
- Copies specified work items from the "ABB Traction Template" to the "ABB Traction" project as children of the Target Work Item ID. | ||
- Alternatively, for missing IDs, creates new "PBI" work items with details (Title, Area Path Assignment, and Product Information) from the JSON file, including a "ToBeClarified" tag to indicate the need for additional description and acceptance criteria. | ||
Typical usage: | ||
|
||
```powershell | ||
clone --outputPath ..\\..\\..\\..\\TestData\ --jsonFile ..\\..\\..\\..\\TestData\\ADO_TESTProjPipline_V03.json --projectId 540 --templateAccessToken tqvemdfaucsriu6e3uti7dya --targetAccessToken ay5xc2kn5i3xcsmw5fu65ja | ||
``` | ||
|
||
3. **Title Setting:** Assigns the title of each created work item from the JSON file. | ||
## Configuration | ||
|
||
4. **Area Path Assignment:** Specifies the area path for each target work item. | ||
```json | ||
{ | ||
"template": { | ||
"Organization": "orgname", | ||
"Project": "projectname" | ||
}, | ||
"target": { | ||
"Organization": "orgname", | ||
"Project": "projectname" | ||
} | ||
} | ||
``` | ||
|
||
5. **Tagging:** | ||
- Adds tags for each work item as specified. | ||
- In addition, a tag with the Project Identification should be applied to each work item. | ||
## JSON Configuration Input | ||
|
||
6. **Field Updates:** Updates fields for each work item as specified. | ||
```json | ||
[ | ||
{ | ||
"id": 213928, | ||
"area": "TPL", | ||
"tags": "Customer Document", | ||
"fields": { | ||
"title": "Technical specification", | ||
"product": "CC000_000A01" | ||
} | ||
}, | ||
{ | ||
"id": 213928, | ||
"area": "TPL", | ||
"tags": "Customer Document", | ||
"fields": { | ||
"title": "Technical specification", | ||
"product": "CC000_000A02" | ||
} | ||
} | ||
] | ||
``` | ||
|
||
proposed new format not yet adopted: | ||
|
||
|
||
```json | ||
[ | ||
{ | ||
"templateId": 213928, | ||
"fields": [ | ||
{ | ||
"System.Title": "Technical specification" | ||
}, | ||
{ | ||
"Custom.Project": "CC000_000A01" | ||
}, | ||
{ | ||
"System.Tags": "Customer Document" | ||
}, | ||
{ | ||
"System.AreaPath": "#{targetProject}#\\TPL" | ||
} | ||
] | ||
}, | ||
{ | ||
"templateId": 213928, | ||
"fields": [ | ||
{ | ||
"System.Title": "Technical specification" | ||
}, | ||
{ | ||
"Custom.Project": "CC000_000A02" | ||
}, | ||
{ | ||
"System.Tags": "Technical specification" | ||
}, | ||
{ | ||
"System.AreaPath": "#{targetProject}#\\TPL" | ||
} | ||
] | ||
}, | ||
} | ||
] | ||
``` | ||
|
||
7. **Target Project Name:** Sets the title of the Target Work Item ID to match the Project Identification. |