How to require Epic Link on an issue?

Epic Link is locked, presumably because it's an internal field to Jira. When we create a field configuration scheme within our project, we are unable to set it to required -- something we are trying to do for control purposes within this project. I have not found any answers/articles/help to indicate how we can require Epic Link to exist on all issue types within our project.

Please let me know how we can do this...

Thanks in advance!

2 answers

This widget could not be displayed.

Make the Epic Link a required field in the workflow's Create step.

If you make the field required in the configuration scheme, then you'll need to enter an Epic Link when you need to edit some old Stories. You probably will not want to enter any Epic to an obsolete Story.

 

The only problem with this: the read asterisk will not appear next to the field name.

 

Try it out.

Is this workaround good for 6.4/cloud based installs? I'm looking at the Create transition, but I have no options under Validators or Post Functions that would essentially say, "do not create until Epic Link exists."

@Laszlo Kremer I thought of the same idea as you suggested (validator in workflow), but there is still a problem. If user choose an Epic which status is closed, JIRA accepts the value, but don't saves it in created item. It seems that linking item to an Epic is the same thing to editing the Epic, but users don't have a permission to do it (which is intended). This way users still can create issues with empty epic link and don't even know about that. Do you have any ideas, how to solve this situation?

I'm not sure it's feasible, but I'd go for script validation, and examine the status of the linked Epic, and fail the validation. I don't have code for this, that's just an idea. The other thing: I'd keep the closed Epics editable, not to prevent creating the epic link. It's better to have 2 stories that have closed epics linked (which can be monitored by query subscriptions), than have 30 stories where the creator only thinks that the Epic link is set but eventually not saved. To be honest, the "closed ticket is not editable" workflow setting causes more user uncertainty and therefore more JIRA support than leaving it editable, and showing users the history tab. It is as counter-productive as the mandatory fields - most tickets with mandatory fields are filled with a dot or the first select item.

@Laszlo Kremer, thank you for your suggestion, but how can I avoid this check when creating epic by itself? I created the validator, but now I cannot create new issues of type epic.

"Make the Epic Link a required field in the workflow's Create step." - You should only use this in the Story workflow. If you use the same workflow for Epic and Story, copy it, and add the validator only for the Story's flow.

Hmm. I have tried to set this up now without success. It could be something with my S-JQL query, but JIRA does not complain when I set up the validator. Setup is as follows: Epic Link must be set when creating issue. Structure: The default structure of the issue's project S-JQL Query: not ["Epic Link" = NULL] If the Issue Is Not Added to the Structure: Block transition Run as User: Project lead This results in it being impossible to create issues (regardless of if Epic Link is empty of populated). The error message is as follows: Workflow transition was blocked by the Structure Validator. An internal error occurred.

This widget could not be displayed.
Ahmad Danial Atlassian Team Jan 15, 2014

Hey there, Adam.

Have you tried to unlock the Epic Link field (https://confluence.atlassian.com/display/GHKB/How+to+unlock+a+Locked+field) and make it Required in the field configuration that you want it to be?

Warm regards,

Danial

Hi Danial, thanks for your reply! Saw that, but we really didn't want to have to go that route. Is that the only feasible path?

How do we run the SQL statements described by Danial? Please provide details.

Thanks.

You can either connect directly to your database or use a plugin that allows you to run SQL directly from JIRA. You should use the first method and apply the following steps :

 

  • In any case, backup your db before doing anything at the DB level
  • stop JIRA
  • run your sql
  • start JIRA

We've tried the unlock/lock procedure, but a JIRA restart will 'un-require' the Epic Link field.  Another user asked about this here, but no answers at this point.

https://community.atlassian.com/t5/Jira-questions/Epic-link-is-not-a-quot-required-quot-field-after-JIRA-restarts/qaq-p/425008

Has anybody solved this?  Enforcing this on workflow doesn't work for us, because it doesn't cover the case where somebody 'moves' a Bug or Task to a Story.  If we require Epic Link on Story only (as a validator on create transition), then people can get around this by creating as a Bug or Task, then moving the issue to a Story.  The issue is already created so the validator doesn't stop it.

The best I can do is suggest you put the validator on more transitions, as that will force people to put the epic link in before they can move it on through the workflow.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

128 views 2 0
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