Forums

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

How to add custom field values of parent in subtask without using JEP Custom fields in Data centre

keren melinda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 30, 2022

Hi,

Is there any Possiblity to create a Parent custom field in jira data centre more like parent issue, summary and parent issue type to be added in the created subtasks in Jira data centre without using Jira enhancer plugin

1 answer

1 vote
Tuncay Senturk
Community Champion
July 1, 2022

Hi @keren melinda 

Welcome to the Atlassian Community!

Your question was tagged as cloud but as far as I know, this is Jira DC you're asking for.

You can add a workflow post function (using one of the workflow addons) and update the custom fields accordingly. However, the problem is whenever those fields are updated in the parent issue, it needs to be updated in the subtasks as well. So it is best to implement a listener which will listen to issue events and update those fields within the listener code. So, what I would say is it is not a very straightforward process.

keren melinda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2022

Hi @Tuncay Senturk ,

Thankyou for the response. Is there there any listener script available.

I am getting error while trying the below code

import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.component.ComponentAccessor;

IssueManager im = ComponentAccessor.getIssueManager();
MutableIssue issue = im.getIssueObject("ANDROID-38");

def output = ""
for (e in issue.getSubTaskObjects()) {

output = output + e.getSummary() +"," + e.issueType.name + "<br/>"

}

return output



Tuncay Senturk
Community Champion
July 1, 2022

I'm afraid, I don't have any listener script available but bear in mind that the code you shared is inclined to update subtasks when the parent is updated.

However, there may be other scenarios, assume this code ran and updated every subtask. Then another subtask was created. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events