Forums

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

inherit parent to subtask values

Aasha Kathamuthu June 4, 2019

hi we have vwr project field in parent and we would like to create parent project field using script runner and it should inherit parent value.

please help

3 answers

3 accepted

1 vote
Answer accepted
Tuncay Senturk
Community Champion
June 5, 2019

Hello @Aasha Kathamuthu ,

Copying field value to subtask via transition (as @Kathy Hart mentioned) is a good solution. However it has pros and cons. You have to add this post function to every transition, and also you have to consider when parent field changes.

Generally I recommend Enhancer Plugin's Parent Issue Field customfield which is documented here.

With this field you don't have to worry about transitions or changes. Subtasks automatically display the parent's field value.

I hope I was clear.

Tuncay

Aasha Kathamuthu June 7, 2019

@Tuncay Senturk  - I am looking for unpaid plug in.

What i have done is created a script runner field in jira

and i coding that field in script runner plug in.

Tuncay Senturk
Community Champion
June 7, 2019

Ok, you should clarify a bit more.

Share your code, and we can try to help. At this point it is a big black box for me.

Aasha Kathamuthu June 7, 2019

@Tu

"VWR Project" is a single select choice field.

We have created a field (script runner ) type field - (Parent Project Name)

Parent Field Name.JPGCode.JPG

Tuncay Senturk
Community Champion
June 8, 2019

Even I could not get the entire point, you can start with this code.

import com.atlassian.jira.issue.MutableIssue; // also add this import

def vwr = customfIeldManager.getCustomFieldObject("customfield_10xxx") //type your customfield id here
Issue parentIssue = issue.getParentObject();
def parentVwrValue = parentIssue.getCustomFieldValue(vwr);
def mIssue = (MutableIssue)issue;
mIssue.setCustomFieldValue(vwr, parentVwrValue);

Hope it helps

0 votes
Answer accepted
Kathy Hart
Community Champion
June 5, 2019

If you are trying to copy a field from a task level issue into a subtask you don't have to use script runner. It can be done on transition using a post function. "Copy Value from Other Field". 

When you set it up, you select the option: "Copy from Parent"

I do not, however, believe this will work for Epics to Tasks or Stories, nor for any other levels of hierarchy Issues set up in Portfolio. 

0 votes
Answer accepted
Gezim Shehu [Communardo]
Community Champion
June 5, 2019

If I understood correctly, upon creation of subtask, you require a certain custom field to inherit value from parent?

Aasha Kathamuthu June 7, 2019

@Gezim Shehu [Communardo] - yes you are correct.

"VWR Project" is a single select choice field.

We have created a field (script runner ) type field - (Parent Project Name)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events