-
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
1 parent
50c89d4
commit b3ccc50
Showing
2 changed files
with
19 additions
and
5 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,10 +1,15 @@ | ||
from subprocess import check_output, CalledProcessError, STDOUT | ||
|
||
class AzCliException(Exception): | ||
def __init__(self, error): | ||
super().__init__(f'Failed to execute AZ CLI command! Error: {error}') | ||
|
||
def tag_work_items(work_items_ids: list[str], tag: str) -> None: | ||
for work_item_id in work_items_ids: | ||
print(f'Trying to tag {work_item_id} with tag {tag}') | ||
try: | ||
check_output(f'az boards work-item update --id {work_item_id} --org https://dev.azure.com/lukaszadamsielski0187 --fields "System.Tags={tag}"', shell=True, stderr=STDOUT) | ||
check_output(f'az boards work-item update --id {work_item_id} --org https://dev.azure.com/lukaszadamsielski0187 --fields "System.Tags={tag}"', shell=True, text=True, stderr=STDOUT) | ||
print(f'Successfully updated work item {work_item_id} with tag {tag}') | ||
except CalledProcessError as e: | ||
print(f"Update process failed for {work_item_id}, error: {e.output}") | ||
raise AzCliException(f"Update process failed for {work_item_id}, error: {e.output}") | ||
|
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