Hi Team,
I have a parent ticket titled "Task," which will automatically generate three sub-tasks through some automation. The first sub-task comes with a default summary that includes the wording "DBC." This sub-task is created simultaneously when the three automated sub-tasks are generated.
When the "UN Design Reviewer" field in the Task is updated, its value should be copied to the Assignee of the first sub-task with a summary that contains "DBC."
To achieve this, I used a JMWE event-based action that triggers when the "UN Design Reviewer" field value changes on the "Task" issue type. I added the "Copy Issue Fields" JMWE post function to this event-based action to copy the "Design Review" field to the "Assignee" of the first sub-task. However, it is skipping all three sub-tasks and not copying the value to the first sub-task. Did I miss anything?
Hi Team,
I tackled it myself, so anyone interested can refer to it in a feature.
Use Case : An Event‑based Action (EBA) in JMWE that fires when the "UN Design Reviewer" field changes on a Task, and then assign only one of its three sub‑tasks (based on a condition on that specific sub‑task).
Example : The Task issue type automatically generates three sub-tasks, each with different summaries. When the "UN Design Reviewer" field is modified in the Task issue type, the value from this field should be assigned to the first sub-task, which has the summary "DBC," with the same username.
For event based action, we have to add the psot function "Copy Issue Fields", for the use the condition .
Source Issue : Current Issue
Destination Issue : Issues returned by the following Groovy Script
The Groovy Script is :
// Return exactly one sub-task based on your condition
def matches = issue.subTaskObjects.findAll { st ->
// <-- Put your sub-task condition here -->
// Examples:
st.summary?.toUpperCase()?.contains('DBC') && st.status.name != 'Done'
// or: st.issueType.name == 'Technical Sub-task'
// or: st.get("customfield_12345") == "SomeValue"
}
// Return a one-element list with the first match, otherwise an empty list
return matches ? [matches.sort { it.created }.first()] : []
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.