I am trying to use Post Function in my workflow to to automatically create a subtask when an issue gets created. However, I'd like to set different assignees for both Parent task and Subtask, It appears that Post Function is forcing the assignee of the subtask to mimic that of the parent task.
For a variety of reasons I am not using Component in my Issue Creation screen but rather use a Custom Field that mimics Component.
Here is what the sequence of Post Function and any custom script looks like. Below is the exact copy of what I see in my workflow Post Function.
Step 7 uses the following code:
issue.summary = (issue.summary) issue.assigneeId = 'firstname.lastname@example.org'
It is worth noting that Step 7 on its own executes fine and assigns the subtask to the proper user. It is when I try to assign the parent task, that subtask will inherit assignee from the parent task.
Any suggestion is welcome and appreciated!
You can't do that in a listener, you need to do a proper edit if you want to change values after the transaction has already been committed.
You should just a standard script post-function, place it towards the top of the list of post functions, and that should work. Although I don't know what line 1 is supposed to do.
I am using a Custom Field to mimic Component but with a different name. Line 1 essentially copies the value from the custom field into the component. Component has a Lead associated with it. So when ticket gets assigned through Line 2, it will get assigned to the proper owner.
I am having an issue getting the custom script post function executing. My systems set up tells me that ScriptRunner is enabled but for the life of me I cannot get the custom post function to do anything.
Hi @Jamie Echlin [Adaptavist]
But in the documentation here https://jamieechlin.atlassian.net/wiki/display/GRV/Built-In+Scripts#Built-InScripts-Clonesanissueandlinks for cloning it is mentioned that and I quote:
"If you want to override some of the field values rather than have them inherited from the source issue you can specify that in the Additional Code field"
Is it not possible to override the subtask assignee in Additional Code field?
I appreciate your response.
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG