Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JMWE event-based action: when a parent ticket is updated, copy the value to the conditional sub-task

Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2025

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?


1 answer

0 votes
Lakshmi CH
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2025

Hi Team,

I tackled it myself, so anyone interested can refer to it in a feature.

Copy the value from the parent field ('Task Issue Type') to the specific sub-task when the parent has multiple sub-tasks (copy to a single sub-task,  not for all sub-tasks) 

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()] : []

 

Suggest an answer

Log in or Sign up to answer