Create subtasks for each user in project role
Could you advise me how to create a subtask for each user in a project role? Thank you very much.
The subtasks will be assigned depending on the value in custom field. I've done this previously in subtask's own workflow in create transition, but it would be great also to assign the to-be-created subtask with the same post-function.
Comments (10)
-
repo owner -
repo owner Hi @karosalminen,
In order to assign each new sub-task to a user depending on the value of a field you should use "Create issues and subtasks" post-function with the following configuration:
String expression for setting assignee is:
getMatchingValue(%{nnnnn}, ["value_1", "value_2", "value_3"], ["user_1", "user_2", "user_3"])
replacing nnnnn with field code for "My Dependency Field", which is the field used in this example for setting the dependency for assigning issues.
-
Account Deactivated reporter Many thanks! Can you tell me why I'm getting an error for trying to use rolesUserPlays function in post-function "Create issues and subtasks".
-
repo owner You should use function
toString()
in order to convert a string list into a string. Use the following expression:"Sub-task for role: " + toString(rolesUserPlays(^%))
-
Account Deactivated reporter - changed status to resolved
-
Account Deactivated reporter I have one modification for the original question. I would like to create a subtask for each member in project role. The role is the same as value of a custom field. For example, there's a role for each function (e.g. reception) and a custom field for function (which value can be e.g. reception).
Let's say two members exist for role "Reception" and I would like to assign a sub-task for each of them. There's a value "Reception" in a custom field called "Function".
So an an issue would be created per seed string returned by the following string list expression: usersInRole(%{10401}). But how should I assign the sub-task for each member? So far I have only assigned all sub-tasks for the first member in the role:
-
Account Deactivated reporter - changed status to open
Added new, related question
-
repo owner As seed string contains a username per each user in selected project role, you simply have to use the following configuration:
-
Account Deactivated reporter Oh, must have been too obvious! Thanks!
-
Account Deactivated reporter - changed status to resolved
- Log in to comment
Hi @karosalminen,
In order to create a sub-task for each user in a project role you should use "Create issues and subtasks" post-function with the following configuration:
Seed string expression is:
usersInRole("Testers")
, considering that you want to create a sub-task for each user in project role Testers.