@ -61,25 +61,30 @@ For this command to process the following conditions must be met:
|
||||
|
||||
duration += int(seconds[:-1])
|
||||
|
||||
if duration > 0:
|
||||
if duration == 0:
|
||||
|
||||
if str(self._meta.verbose_name).lower() == 'ticket':
|
||||
#ToDo: Add logging that the slash command could not be processed.
|
||||
|
||||
from core.models.ticket.ticket_comment import TicketComment
|
||||
return str(match.string[match.start():match.end()])
|
||||
|
||||
comment_text = f'added {time} of time spent'
|
||||
|
||||
TicketComment.objects.create(
|
||||
ticket = self,
|
||||
comment_type = TicketComment.CommentType.ACTION,
|
||||
body = comment_text,
|
||||
duration = duration,
|
||||
user = self.opened_by,
|
||||
)
|
||||
if str(self._meta.verbose_name).lower() == 'ticket':
|
||||
|
||||
if str(self._meta.verbose_name).lower() == 'comment':
|
||||
from core.models.ticket.ticket_comment import TicketComment
|
||||
|
||||
self.duration = duration
|
||||
comment_text = f'added {time} of time spent'
|
||||
|
||||
TicketComment.objects.create(
|
||||
ticket = self,
|
||||
comment_type = TicketComment.CommentType.ACTION,
|
||||
body = comment_text,
|
||||
duration = duration,
|
||||
user = self.opened_by,
|
||||
)
|
||||
|
||||
elif str(self._meta.verbose_name).lower() == 'comment':
|
||||
|
||||
self.duration = duration
|
||||
|
||||
else:
|
||||
|
||||
@ -87,4 +92,5 @@ For this command to process the following conditions must be met:
|
||||
|
||||
return str(match.string[match.start():match.end()])
|
||||
|
||||
|
||||
return None
|
||||
|
2
makefile
2
makefile
@ -24,7 +24,7 @@ prepare:
|
||||
|
||||
|
||||
markdown-mkdocs-lint:
|
||||
PATH=${PATH}:node_modules/.bin markdownlint-cli2 docs/*.md docs/**/*.md docs/**/**/*.md docs/**/**/**/*.md docs/**/**/**/**/**/*.md !CHANGELOG.md !gitlab-ci !website-template
|
||||
PATH=${PATH}:node_modules/.bin markdownlint-cli2 docs/*.md docs/**/*.md docs/**/**/*.md docs/**/**/**/*.md docs/**/**/**/**/**/*.md !CHANGELOG.md !gitlab-ci !website-template || true
|
||||
|
||||
|
||||
docs-lint: markdown-mkdocs-lint
|
||||
|
Reference in New Issue
Block a user