Show parent task's fields in the sub task create screen

I know there are ways we can "copy" the parent task's fields in the sub task. But my requirement is quiet different. I want to show the parent task's fields (in editable mode) in the sub task's create screen, so that users who wish to change the values can change, simply create with same values otherwise.

Please suggest a way to acheive this. I have Jira Misc add-on and scriptrunner installed in my Jira server.

1 comment

Tarun Sapra Community Champion Jun 13, 2017

Hi Chithra,

You can add the field on the sub-task create screen, and mention in the description of the field that it will "override" the parent task's field value other it will copy the field value from the parent. And if the user fills in some value in this field then just use the script runner in the pot funtion to update the parent issue with the new field value.

The issue object as the method - getParentObject()

Once you have the parent issue object then you can call the method - updateValue on the custom field object to update parent's field value -

https://developer.atlassian.com/static/javadoc/jira/latest/reference/com/atlassian/jira/issue/fields/OrderableField.html#updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.ModifiedValue, com.atlassian.jira.issue.util.IssueChangeHolder)

And if it's a system field and not a custom field which you wish to update on the parent then it's even easier as MutableIssue class has all the setters -

https://developer.atlassian.com/static/javadoc/jira/latest/reference/com/atlassian/jira/issue/MutableIssue.html 

Comment

Log in or Join to comment
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,267 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot