Forums

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

Validate the parent ticket fields in subtask transition

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.
March 5, 2024

Hi Team,

 I have a requirement, 

If the "Team Manager" and "Team Manager - Validation" fields (both are user picker type fields)  on the parent ticket are empty,  Assign to the person on the "Team Manager - Validation" field in the Sub-Task ticket (copy the "Team Manager - Validation" to Assignee)

I used this copy field to field JMWE post function, but its not working. Is there any correction in the function.

((issue.get("Issue Type")?.name == " Parent Ticket") && (issue.getAsString("Team Manager") == " " && issue.getAsString("Team Manager - Validation") == " "))

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Champion
March 5, 2024

Hi @Lakshmi CH 

I'll not sure I understand what you're trying to achieve. Could you please explain it with an example? Also, can you share the full configuration of the post function, not just a script without context?

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.
March 6, 2024

Hi @David Fischer ,

 Apologies for the confusion!

We have two user picker fields "Team Manager" and "Team Manager - Validation" on both parent and subtask.

If the "Team Manager" and "Team Manager—Validation" fields on the parent ticket are empty when a subtask moves to a particular transition, then the value of the "Team Manager—Validation" field on the subtask should be copied to the "Assignee" field.

 

 

David Fischer
Community Champion
March 6, 2024

Hi @Lakshmi CH 

since the post-function is triggered by a transition of sub-tasks, the "current" issue in the post-function is the sub-task, and therefore the "issue" variable refers to the sub-task, not its parent.

Therefore, the conditional execution script should be:

issue.parentObject && !issue.parentObject.get("Team Manager") && !issue.parentObject.get("Team Manager - Validation")

Of course, I'm assuming the post-function is already configured to copy the "Team Manager—Validation" to the Assignee field. 

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.
March 7, 2024 edited

Thank you so much @David Fischer . It's working as expected now.

Yes,  I added the post-function copy the "Team Manager—Validation" to the Assignee field, and added the above line of script in "Condition"

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, mindful member, mindful member badge, atlassian community, community kudos, community giveaway, atlassian swag, community values, empathy and kindness, badge challenge, atlassian learning, community engagement, swag giveaway

Earn a Badge, Win a Prize 🎁

Earning the Mindful Member badge proves you know how to lead with kindness, plus it enters you into a giveaway for exclusive Atlassian swag. Take the quiz, grab the badge, and comment on our announcement article to spread the good vibes!

Start here
AUG Leaders

Atlassian Community Events