Forums

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

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

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.
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 :

issue.parentObject.issueType.name == "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 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.
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