Short_name is not filled

async def ensure_task_status(
    project: "ProjectEntity",
    task_status_name: str,
) -> bool:
    """#TODO: cerebro listener for new task statuses would be preferable"""

    if task_status_name not in [status["name"] for status in project.statuses]:
        logging.info(f"Creating task status {task_status_name} for '{project.name}'")
        project.statuses.append(
            {
                "name": task_status_name,
                "short_name": task_status_name[:4],
            }
        )
        await project.save()
        return True
    return False

This code creates the new task type but doesnt create the short_name for it for some reason. Attaching the example
image

Hi @vivimage!

The anatomy attribute for the “Short name” is actually called shortName rather than short_name, you can see it if you try hitting the “Copy anatomy” and then paste it into a text editor:

  "task_types": [
    {
      "name": "Modeling",
      "shortName": "mdl",
      "icon": "language",
      "original_name": "Modeling"
    },
    {
      "name": "Shading",
      "shortName": "shdn",
      "icon": "format_paint",
      "original_name": "Shading"
    },

This is unfortunately also broken in the Kitsu integration addon (where I’m guessing you got this code from), there’s an open issue for it at:

But changing from short_name to shortName as the key should theoretically fix the issue for you I believe!

Cheers,
Nikhil

Hi @nobleyknees , I just made a PR to solve that specific issue: Fix Kitsu Task type and status sync + tests by johhnry · Pull Request #81 · ynput/ayon-kitsu · GitHub :innocent:

1 Like