Hi,
tl;dr
if I fill a field in the first post function of a transition, and then create a subtask in a second post function of that same transition, the value of the field is not copied into the subtask. How can I force this?
Full explanation:
I'm trying to prevent people from reviewing their own work in Jira. I'm not talking about code-reviews or something like that, but a procedural check by someone else to see that we have not forgotten anything and that all systems are running correctly before releasing it to our customers. As we work with large teams / departments in a single project in Jira, the pool of potential review candidates is large and varies often.
The workflow is pretty straight forward:
- Backlog
- Analysis
- In progress
- Done
Between step 2 and 3, a variable number of subtasks is automatically created depending on what needs to happen (e.g. Design, Documentation, Implementation, Test and Review).
To prevent people from reviewing their own work I've added a couple of post functions in the transition between 2 and 3. First off, I use a simple script to populate a custom user picker field 'Current user' with the account of the person that has clicked the transition. Second, I create a subtask 'Review' where I copy all fields in. To prevent the self-review, I make sure that the transition in the review subtask cannot be performed if the user equals the value of the custom field.

Main ticket:

Sub-task:

The issue then is that despite the first post function working well (the 'Current user' field is filled with the correct information), the field remains empty in the subtask.
I tried to add a third post function that explicitly copies the value from main task into the subtask, but to no avail.
When I split the two actions (fill the field 'Current user' one transition before, and then create a subtask in the next transition), everything works exactly like it's supposed to, but I would hate to add a status just to fix this problem.
Is there a way to get this all done in a single transition?