How to require Epic Link on an issue?

Adam Beckerman January 15, 2014

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

1 vote
Laszlo Kremer
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.
November 17, 2014

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.

JamieY December 17, 2014

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."

Matylda Kozłowska-Igła December 29, 2014

@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?

Laszlo Kremer
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 5, 2015

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.

Alexey Zagarin January 20, 2015

@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.

Laszlo Kremer
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 20, 2015

"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.

Lars Sundell February 5, 2015

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.

1 vote
AhmadDanial
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 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

Adam Beckerman January 15, 2014
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?
Tyler Brandon March 6, 2014

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

Thanks.

Corentin Méhat
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.
June 9, 2016

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

Deleted user October 25, 2017

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.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 25, 2017

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