✨️ add ability to change ticket status
also setting the 'close_ticket' entry is no longer necessary
This commit is contained in:
parent
7da23b7fc8
commit
4f62a1662d
2 changed files with 6 additions and 3 deletions
|
@ -4,7 +4,7 @@ redmine:
|
|||
url: ${REDMINE_URL}
|
||||
version: ${REDMINE_VERSION}
|
||||
api_key: ${REDMINE_API_KEY}
|
||||
issue_closed_id: "5" # Id of the "closed" status
|
||||
issue_closed_id: 5 # Id of the "closed" status
|
||||
|
||||
|
||||
actions:
|
||||
|
@ -26,7 +26,7 @@ actions:
|
|||
- "IT Tickets"
|
||||
status:
|
||||
- "In revision"
|
||||
close_ticket: false
|
||||
change_status_to: 4
|
||||
template: "nudge_ticket"
|
||||
|
||||
|
||||
|
|
5
main.py
5
main.py
|
@ -52,9 +52,12 @@ def treat_issues():
|
|||
notes = template.render(author=issue.author.name, time_range=action['time_range'], url=issue.url)
|
||||
|
||||
# Update issue
|
||||
if action['close_ticket']:
|
||||
if action.get('close_ticket') is True:
|
||||
redmine.issue.update(issue.id, notes=notes, status_id=config['redmine']['issue_closed_id'])
|
||||
logging.info(f"Ticket ID: {issue.id}, ticket closed")
|
||||
elif action.get('change_status_to') is not None and isinstance(action.get('change_status_to'), int):
|
||||
redmine.issue.update(issue.id, notes=notes, status_id=action['change_status_to'])
|
||||
logging.info(f"Ticket ID: {issue.id}, changed ticket status")
|
||||
else:
|
||||
redmine.issue.update(issue.id, notes=notes)
|
||||
logging.info(f"Ticket ID: {issue.id}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue