I would like to auto-name tasks with a short code from the project associated with that task, somewhat like Jira does it.
I’ve added a mandatory “project_code” field to the Project doctype.
I’ve also made the Project link field mandatory in the Task doctype.
I would like to do something like:
template:{project.project_code}-{####}
But of course that doesn’t work, because the Task does not have access to the fields inside of the linked Project.
Is there a way to access the fields for Link field types in a form or when generating a name?
in your case, since the task doesn’t have direct access to the project fields, you could consider using a custom script to fetch the project code when creating the task
If you’re trying to auto-name tasks with a project code, a common approach is to make sure the naming convention pulls the relevant information from the linked project. In your case, since the Task doesn’t have direct access to the Project fields, you could consider using a custom script to fetch the project code when creating the task.
You might also want to explore using a pre-defined jira ticket template example for inspiration. These templates can give you a clear idea of how to structure your task names efficiently.