https://github.com/moduscreateorg/azure-devops-boards-scripts
Repository to store Azure DevOps Boards scripts.
https://github.com/moduscreateorg/azure-devops-boards-scripts
Last synced: 3 months ago
JSON representation
Repository to store Azure DevOps Boards scripts.
- Host: GitHub
- URL: https://github.com/moduscreateorg/azure-devops-boards-scripts
- Owner: ModusCreateOrg
- License: mit
- Created: 2023-02-10T21:36:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T08:55:07.000Z (about 2 years ago)
- Last Synced: 2025-01-26T18:27:57.986Z (5 months ago)
- Language: Shell
- Size: 36.9 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Azure DevOps Automation
[](./LICENSE)
[](https://moduscreate.com)- [Objective](#objective)
- [Architecture-chart](#architecture-chart)
- [How it works](#how-it-works)
- [Tutorial](#installing-on-azure-devops)
- [Important notes](#important-notes)
- [Modus Create](#modus-create)
- [Licensing](#licensing)## Objective
### Calculate “Effort”
- Automatically sum “Product Backlog Item” field “Effort” and add the total to the field “Effort” on the respective “Feature”;
- Automatically sum “Product Backlog Item” field “Effort” (state=“done”) and add the total number to a custom field called “Completed Effort” on the respective “Feature”;
- Automatically calculate the Percentage effort concluded (done) and add the percentage number to a custom field called “Percentage Completed Effort” on the respective “Feature”;### Calculate “Start Date” and “End Date”
- Based on “interactions” assigned to “Product Backlog Items” update the parent’s feature “Start Date” and “Target Date”.
- The “Start Date” will be the minimum iteration date and the “Target Date” will be the maximum iteration date.
Example: If a “Feature“ has 3 “Product Backlog Items”, 2 “Product Backlog Items” assigned to “sprint 23.1.1“ and 1 “Product Backlog Items” assigned to “sprint 23.1.2“ the respective “Feature” will receive the following values: Start Date: 1/1/2023 and End Date: 1/14/2023.### Status Automation
- Status will change automatically based on rules on file "states.json"
- "states_x" means: If all Backlog Items are set to this state the parent feature will be set to states_x_set_status
- "states_x_one" means: If any Backlog Items are set to this state the parent feature will be set to states_x_one_set_status### Demo
- There is a video showing how it works at:
https://github.com/ModusCreateOrg/azure-devops-boards-scripts/blob/main/docs/video/how_it_works.mp4?raw=true## Architecture chart
## How it works
When you update a “Product Backlog Item” on Azure Boards a WebHook will automatically trigger an Azure Pipeline and a Bash process (stored on Git) will run, calculate and update the fields on Azure Boards.
The bash process uses the “az boards“ client which calls the Azure DevOps API.The fields on “Feature” will be updated a few seconds after saving the “Product Backlog Item” (as soon as the pipeline finishes running). The user must refresh the page to see the results after the update.
To avoid using unnecessary resources the script will run only when fields (effort, state or interation) are updated on “Product Backlog Items”.If you set "states_enabled=1" on variable Library it will also run the status automation based on rules stored at variable Library called "states". The file states.json is a template to create the json. (Note: You must store the json on variable Library - the file is just a template - changing the file won't work)
## Installing on Azure Devops
### Permissions
To configure the process “Administrative Access” to Azure Devops will be necessary as well as a technical user.
- Basically we need permission to do the following actions:
- Azure Boards - Full control over the resource
- Make changes on “Project Configuration” (Add/Remove/Edit Interactions)
- Customize the “Azure Board” (Organization Settings/Boards/Process) - If we can’t have administrative permissions on organization level, please create the fields as described on configuration (step number 2)
- Create/Edit Service Connections
- Create/Edit Service Hooks
- Create/Edit Azure Pipelines
- Create an Azure Personal Access Token### Configuration
1. Create the Interactions on Azure Devops based on the standards (Project Settings - Project Configuration)

Important note: If you don't have Strints (3rd. level interactions) the process won't calculate the “Start Date” and “End Date”2. Customize the Azure Board adding the fields “Percentage Completed Effort” and “Completed Effort” on “features” and also a field called “ParentId” on “Product Backlog Item”;

3. Create a library called devops_boards and make variable customizations based on client’s board configuration (you can also check devops_variables.sh);

4. Create the pipelines using the yml files stored on Git (existing YAML pipeline file) and set the secret “AZURE_DEVOPS_EXT_PAT” on pipeline;

5. Make sure you have ubuntu-latest agents available to run the pipeline;
- Generate a Personal Access Token to be used by the agent
- If you are using self-hosted agent follow the instructions on Azure DevOps
- Make sure you have “az client” and “az board” installed on agent machine
6. Create the all Service Connections;
- incoming_webhook_connection_trigger_date
- incoming_webhook_connection_trigger_devops
- incoming_webhook_connection_trigger_effort
7. Create the Service Hooks (You can tun the file "/webhooks_create/webhooks_create.sh" to create the webhooks automatically - be sure you replaced the variables on bash file with the respective values)

8. Test the pipelines and webhook to make sure it’s working properly
## Important notes
- The process can run on “Azure Agents” or “Self-Hosted Agents” based on clients' needs. If the client runs software development pipelines on Azure DevOps we can create and use a small ubuntu Self-Hosted Agent machine to run the pipeline avoiding concurrency with development teams pipelines;
- The maximum expiration period for an Azure Personal Access Token is 1 year. Before the expiration date the Personal Access Token must be renewed on Azure Devops and updated at Aha! Integration, otherwise the integration will stop working.## Modus Create
[Modus Create](https://moduscreate.com) is a digital product consultancy. We use a distributed team of the best talent in the world to offer a full suite of digital product design-build services; ranging from consumer facing apps, to digital migration, to agile development training, and business transformation.
This project is part of [Modus Labs](https://labs.moduscreate.com/?utm_source=labs&utm_medium=github&utm_campaign=Azure_DevOps).
## Licensing
This project is [MIT licensed](./LICENSE).