get task status python

2 posts / 0 new
Last post
get task status python

   I'm trying to create some tools to handle tactic in python. Given that I have the asset that I am working on and I know which part of the workflow I am looking at. is there a way with python to return a list of available task statuses?


Looking through the API code, there really isn't a good clean way of doing this.  Even the widget that selects the status list drop down on the Table does it manually.  The way to do this is to use server code (not API)

from import Pipeline
pipeline = Pipeline.get_by_sobject(sobject)
attrs = pipeline.get_process_attrs(process)
task_pipeline_code = attrs.get('task_pipeline')
task_pipeline = Pipeline.get_by_code(task_pipeline_code)
statuses = task_pipeline.get_process_names()

Not pretty, admittedly, but it should work.