File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,13 @@ async def ticket_status(action: Action, app: SirBot):
3232 Updates the ticket status dropdown. (I don't know why we need to manually
3333 update the message for this..)
3434 """
35- logger .info (action )
36- response = updated_ticket_status (action )
37- await app .plugins ["slack" ].api .query (methods .CHAT_UPDATE , response )
35+ slack = app .plugins ["slack" ].api
36+
37+ response , selected_option = updated_ticket_status (action )
38+ update_message = update_ticket_message (action , selected_option ['text' ])
39+
40+ await slack .query (methods .CHAT_UPDATE , response )
41+ await slack .query (methods .CHAT_POST_MESSAGE , update_message )
3842
3943
4044async def open_ticket (action : Action , app : SirBot ):
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ def base_response(action):
2929 return response
3030
3131
32+ def update_ticket_message (action , selected_value ):
33+ user = action ["user" ]["id" ]
34+ update_message = (f'<@{ user } > updated status to { selected_value } at '
35+ f'<!date^{ now ()} ^{{date_num}} {{time_secs}}|Failed to parse time>' )
36+ return {
37+ 'text' : update_message ,
38+ 'channel' : action ['channel' ]['id' ],
39+ 'thread_ts' : action ['message_ts' ]
40+ }
41+
42+
3243def updated_ticket_status (action ):
3344 selected_option = action ['actions' ][0 ]['selected_options' ][0 ]
3445 selected_option ['text' ] = TICKET_OPTIONS [selected_option ['value' ]]
@@ -39,7 +50,7 @@ def updated_ticket_status(action):
3950 ** base_response (action ),
4051 'attachments' : updated_attachments
4152 }
42- return response
53+ return response , selected_option
4354
4455
4556def ticket_attachments (action ):
You can’t perform that action at this time.
0 commit comments