-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Construct the custom team label for the current week something like gold_2404_w3...
- gold -> Team label
- 24 -> 2024
- 04 -> April
- w3 -> 3rd week of April
import datetime
def labeller(current_date):
year = str(current_date.year)[2:]
month = str(current_date.month).zfill(2)
week_number_of_month = (current_date.day - 1) // 7 + 1
label = "crystal_" + year + month + "_w" + str(week_number_of_month)
# debug
print(f"{current_date} | {year} | {month} | {week_number_of_month} |>>>> {label}")
response = requests.post(update_labels_api, auth=(username, password), headers=headers, json={"labels": [label]})
# Check if the request was successful
if response.status_code == 204:
print(f"Label '{label}' added to issue '{issue_key}' successfully.")
else:
print(f"Failed to add label '{label}' to issue '{issue_key}'. Status code:", response.status_code)
Metadata
Metadata
Assignees
Labels
No labels