Skip to content

Commit

Permalink
add new endpoints for filtering and updating tasks
Browse files Browse the repository at this point in the history
Signed-off-by: Conrado Costa <[email protected]>
  • Loading branch information
costaconrado committed Oct 24, 2023
1 parent 1549c6e commit da335be
Show file tree
Hide file tree
Showing 14 changed files with 10,269 additions and 480 deletions.
13 changes: 13 additions & 0 deletions apps/osim/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ def get_enter_automatically(self, workflow_name, state_name):
f"Combination of workflow and state ({workflow_name}, {state_name}) is not present in framework."
)

def get_jira_status(self, state_name, workflow_name=""):
for workflow in self._workflows:
if workflow_name == "" or workflow.name == workflow_name:
for state in workflow.states:
if state.name == state_name:
return (state.jira_state, state.jira_resolution)
raise StateNotFoundException(
f"Combination of workflow and state ({workflow_name}, {state_name}) is not present in framework."
)


class WorkflowModel(models.Model):
"""workflow model base class"""
Expand Down Expand Up @@ -191,3 +201,6 @@ def adjust_classification(self, save=True):
return

self.save()

def get_jira_status(self):
return WorkflowFramework().get_jira_status(self.osim_state, self.osim_workflow)
Loading

0 comments on commit da335be

Please sign in to comment.