How to access the parent ticket field values in the subtask copy fields postfunction's condition.

Lakshmi S April 30, 2024

Hi Team,

How to validate the parent ticket fields in the subtask post function.

The requirement is :

On the parent "Project" issue type has New Customer = Yes and Solution Engineer is unassigned and Solution Strategist - Engineer is not unassigned 

Action on that parent-related sub-task---------- Assign to Solution Strategist - Engineer from the parent "Project" when ticket is moving to particular transitions.


I used "Copy Issue Fields Post Function"

Source Issue : Parent Issue of the current sub-task

Destination Issue : Current Issue

Fields to Copy : Solution Strategist - Engineer to Assignee


And the condition is : == "Opportunity"  && issue.getAsString("customfield_34222") == "Yes" && issue.getAsString("customfield_32105") == "'

I think i am accessing current (sub-task) issue fields here (issue.getAsString("customfield_34222") == "Yes" && issue.getAsString("customfield_32105") == "'), how to access the parent ticket values ?

1 answer

0 votes
Lakshmi S May 2, 2024

NVM, I figured out.

We should use the below script to access the parent ticket values in the subtask.

issue.parentObject && issue.parentObject.get("customfield_34222") == "Yes"

Suggest an answer

Log in or Sign up to answer