Fix auth token parsing, remove column dependency, add --status open for non-closed tickets
This commit is contained in:
23
scripts/patch.py
Normal file
23
scripts/patch.py
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
path = "/workspace/skills/bms/scripts/bms-tickets.sh"
|
||||
with open(path, "r") as f:
|
||||
lines = f.readlines()
|
||||
|
||||
# Find the line that is exactly ' local sep=""\n'
|
||||
for i, line in enumerate(lines):
|
||||
if line.strip() == 'local sep=""':
|
||||
insert_idx = i + 1
|
||||
new_lines = [
|
||||
' if [[ "$status" == "open" ]]; then\n',
|
||||
' filter+="\\"StatusNames\\":\\"Escalated,Open,Waiting for Customer,Waiting for Product(s),Waiting for Vendor\\""\n',
|
||||
' sep=","\n',
|
||||
' status=""\n',
|
||||
' fi\n',
|
||||
]
|
||||
lines[insert_idx:insert_idx] = new_lines
|
||||
break
|
||||
|
||||
with open(path, "w") as f:
|
||||
f.writelines(lines)
|
||||
print("Patched after local sep line")
|
||||
Reference in New Issue
Block a user