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 Sign up to comment
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

5 ways you can make the most of Jira Software and Bitbucket Cloud

As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...

78 views 0 5
Read article

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