Test Becomes a Sub-task After Linking a Defect at the Execution Screen

July 04, 2019

In JIRA, the subtask relationship at a low level is nothing more than an issue link. Starting around JIRA 4.1, the idea of Subtasks became a reality but it was optional at the time. Issue links also weren't quite what they are, today. When Subtasks were enabled, the link was granted a JIRA ID of 10000, what is commonly reserved for the "Relates to" issue link in newer post 4.x installations of JIRA.

In Zephyr for JIRA, we have logic that first checks for "Relates to" as a link type, and if it doesn't find it, defaults to ID 10000. In version of ZFJ pre-2.6, we hard-coded this value to "Relates to" instead of an ID, so if you didn't have "Relates to" specifically described as a link, we just didn't bother, which is why, if you were to downgrade, you wouldn't have this problem. 

How to fix this issue

Before you do this, we recommend making sure your JIRA instance is backed up. There's nothing that would indicate a problem; it's just good practice. We also recommend reading the whole fix before starting so you're aware of what to expect.

What we'd like you to do is navigate to Administration > Manage Add-ons > Zephyr for JIRA (left menu) > General Configuration. You can also hit the period key, type "Zephyr" and choose the first option.

On that page, you'll see a dropdown menu:

Select your "Related" link. It will auto save redo any links created by Zephyr for JIRA. If you have any genuinely created subtasks, those should remain intact. My instance is set to "Blocks" instead of "Relates to," but the idea is the same. Depending on the size of your instance and how many tests/executions you have, this'll take anywhere from two to 30 minutes.

You should only need to do this once. What we're doing is telling Zephyr for JIRA which relationship to use from now on, no matter what. Every new link created thereafter should adhere to this setting.


If you still run into this issue after making this change, please open a new case with us. Each environment is slightly different so please provide us with the following:

  • JIRA version? (for record keeping)
  • Any 3rd party plugins installed that may have this functionality built into it that you're aware of? (we don't want to accidentally step on a plugin that does this type of behavior on purpose; the number of plugins that do this is very small but we still want to be careful)
  • Atlassian Support Zip. You can find this at Administration > System > Support Tools; check all boxes and upload to this ticket. (this will give us a complete picture of your environment without actually touching your environment. This is the same file that Atlassian Support commonly asks for when trying to reproduce bugs and other issues. If it's over 20MB, please let us know and we'll provide an alternate upload location.)
  • An anonymized JIRA backup of your instance. You can read more about Atlasssian's Anonymizer and how it works here. This will give us a complete picture of what you're working with without revealing sensitive information. (this part is very much optional but is helpful if you can't provide the last item. If it's over 20MB, please let us know and we'll provide an alternate upload location.)
  • Your JIRA's issuelinktype and issuelink database tables as a text file, CSV, or some other flat file. These former contains a list of only the link types that exist in your JIRA instance, the latter contains issue links by ID. (optional, but still very helpful because this gives us a plain view of what we're working with.