Set Issue Assignee Based on Epic Assignee

Is there a way using either stock JIRA\Greenhopper or an add-on which will allow me to set an issue's assignee to match the assignee of either a linked issue or an epic?

My team works on a variety of products and we use epics as a way to roll up all of the stories associated with a particular product. Each product (and therefore epic) has a technical lead (who I store in the epic's 'assignee' field) and I'd like any stories linked to that epic to inherit that assignee by default.

We also use linked issues to track bugs associated with particular stories, and it would be awesome if I could auto-assign those bugs to the owner of the originating story as well.

2 answers

I've been doing some research on some other issues and came across the 'Behaviors' and 'Script Runner' add-ons, both of which might be able to handle this. Can anyone confirm? We're running onDemand right now so I can't really test either one yet.

I'm probably a bit late to help you, but Jira Misc Workflow extensions add-ons provides lots of additional post-functions that can enable you to inherit from parents or linked items (or to set parents or linked items). See attached screenshots for examples.

If you want the user to see the field values in the create form (rather than for them to be added in a post-function) you would need to write a jira Behaviours script.

Thanks Mark! We actually ended up transitioning to a different epic\story architecture that negates this use-case, but I will give this a crack when I get a minute and see if it works. My only concern is that it doesn't look like adding a story to an epic uses the same "linked issues" logic, so it might not be able to take advantage of these post-functions.

Yes, putting this in a post function is quite limiting. We've also written Jira Behaviours scripts to inherit story attributes from their parent.

The script below takes a custom field from the epic and puts in on the child. You could adapt this for other fields (e.g. assignee)

// Set SVR Number based on the SVR Number of the parent epic (if one exists)
//
// Script by Mark Love, 4th July 2014

import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager 
import com.atlassian.jira.issue.fields.CustomField

// Set up variables to link to the two form fields we're interested in
FormField SVR = getFieldByName("SVR Number")
FormField epicLink = getFieldByName("Epic Link")

// The value of the Epic Link field includes the prefix "key:" so we need to get rid of this
def epicLinkKey = epicLink.value.replaceAll("key:", "")

// Set up objects to enable us to access the parent issues and custom field
ComponentManager componentManager = ComponentManager.getInstance()
CustomFieldManager customFieldManager = componentManager.getCustomFieldManager()

// get an issue object for the parent
def epic = componentManager.getIssueManager().getIssueObject(epicLinkKey)

// create a custom field object for SVR Number
cfSVR = customFieldManager.getCustomFieldObjectByName("SVR Number")
// get the value of SVR for the epic
def epicSVR = epic.getCustomFieldValue(cfSVR) 

// update the value on the form with the value from the parent.
SVR.setFormValue(epicSVR)

I think this would probably do the trick, but as OnDemand users we can't use them. Wa waaaaa.

Suggest an answer

Log in or Join to answer
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,183 views 13 19
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