The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How to get subtask parent ID and copy to text field in subtask using script runner

Nannette Mori
Contributor
October 12, 2022

How do I copy the subtask parent id to a custom text field in the subtask using script runner

 

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Nic Brough -Adaptavist-
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 Champions.
October 12, 2022

The main bit of code you need is simply

issue.getParentObject().getKey()

For writing it away, there's a good guide to setting most types of field at https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console

DEPLOYMENT TYPE
SERVER
VERSION
8.20.1
TAGS
AUG Leaders

Atlassian Community Events