Forums

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

Get issue parent

Eduard Diez
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 12, 2020

Hi community;

 

I'm new in the JIRA server and I need your help for a update a issue. But this issue need the information father, so firstly I need search the parent name, and I do this but the result is 

 

null. I put my code. Thanks.

 

Captura.PNG

 

1 answer

1 accepted

1 vote
Answer accepted
Payne
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 12, 2020

There exists a getParentObject() method in the Issue class - https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/Issue.html#getParentObject--

Edit - d'oh! - I see you're using it.

OK, so note that it'll return null if the issue in question is not a sub-task. Is SSCC2619-2 a sub-task?

Eduard Diez
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 12, 2020

Corect, SSCC2619-2 is not a subTask.

So how I can search the parent of this Task?

Because when I do a X issue I create this task, and I want to know how i can update this task when I modify the X issue parent ( For me parent) 

 

Thanks @Payne !!!

Like admin likes this
Payne
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 13, 2020

If it's not a sub-task, then it has not parent as far as Jira is concerned. What is your definition of parent? How are the 2 issues related?

Eduard Diez
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 13, 2020

Yes, their are two issues related. So if the first issue change the second automatically change also.

This is possible in cloud but in server I don't know how I can do.

 

Thanks @Payne 

Payne
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 13, 2020

Issues that are linked (Relates To, etc.) have no parent/child relationship. Here's a previous thread in the Community that may give you some guidance - https://community.atlassian.com/t5/Answers-Developer-Questions/Inward-Outward-links-in-groovy-only-one-way-working/qaq-p/513872

Like admin likes this

Suggest an answer

Log in or Sign up to answer