Forums

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

field inheritance

Nicolas Mayans January 4, 2023

Good day and happy new year community!
They are asking me for a configuration which is that when creating an epic it inherits a field with its value already entered in another incident.
I give an example: an issue Brief is created with a field and its value. Then several Epics are created which belong to that Brief, those epics would need to inherit that field from the brief.
I hope I was clear.

Regards!

1 answer

0 votes
Deepak Rai
Community Champion
January 4, 2023

To configure JIRA to inherit a field from another issue when creating an epic, you can use a script runner post function or a JIRA automation rule to copy the value of the field from the parent issue to the epic.

Here's an example of how you can do this using a script runner post function:

  1. Install and enable the Script Runner plugin in your JIRA instance.
  2. Go to JIRA Administration > Add-ons > Script Runner.
  3. Click the "Post Functions" tab and then click the "Add Post Function" button.
  4. In the "Add Post Function" dialog, select the "Script" post function and click the "Add" button.
  5. In the "Script" field, enter the following script:

def parentIssue = issue.getParentObject()
if (parentIssue) {
def fieldValue = parentIssue.getCustomFieldValue(customFieldManager.getCustomFieldObjectByName("FIELD_NAME"))
issue.setCustomFieldValue(customFieldManager.getCustomFieldObjectByName("FIELD_NAME"), fieldValue)
}

Replace "FIELD_NAME" with the name of the field you want to inherit from the parent issue.Click the "Save" button to save the post function.

Now, when you create an epic and link it to a parent issue, the script will run and copy the value of the specified field from the parent issue to the epic.

Alternatively, you can use a JIRA automation rule to copy the value of the field from the parent issue to the epic. To do this, you will need to enable the JIRA automation plugin and create a rule that triggers when an epic is created and linked to a parent issue. The rule should include an action to copy the value of the field from the parent issue

Nicolas Mayans January 4, 2023

Thank you! in our case we don't use script runner only automation.

Nicolas Mayans January 4, 2023

Regarding jira automation, can this action be performed even if it is from another project?

Nic Brough -Adaptavist-
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.
January 7, 2023

I'm sorry, but that answer is a load of junk.  It was written by a robot/AI that has no understanding of Jira at all.

Suggest an answer

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

Atlassian Community Events