We have instances where, when a Story (which is linked to an Epic via the "Epic Link") is changed to an Epic, the "Epic Link" doesn't get removed. The other Epic continues to List this Issue (now AN Epic) under its "Issues in Epic" tab.
Is there any way to remove the Epic Link when a Story is changed to an Epic ?
We had a similar scenario with Parent link & implemented the below fix given by Atlassian,
But, when I try the same steps with Epic Link, it doesn't work.
Any help on this is much appreciated. Thank you !
I have looked into Atlassian's workaround, but it is indeed not working on my instance for the Epic Link field. Instead, I did as follow with success :
Let me know how that goes for you.
@Antoine Berry For some reason, I still see the converted Epic (which used to be a story) showing up under the other Epic's "Issues in Epic" section
Here is how I tested
Created a Story . Then updated its "Epic link" with an Epic
Now converted this Story into an Epic.
But the original Epic still listing this converted Story under it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you check the Audit log of the automation rule ? You should see an error if the rule is correctly created and applied.
I tested exactly like you did and it worked fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The audit shows success. But, I still find the old parent of the Story listing the Story (now an Epic) under "issues in epic" . . Basically, there is Epic listing an Epic (which is supposed to be wrong when taking the hierarchy of issues)
I also noticed, when I again move the Epic (Feature) back to a Story, the old Feature link comes back . . Which might mean it din get cleared in the first place
I also came across this very old Bug -
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you check the audit log, can you confirm that the success message looks as follows, adn that the datetime matches with the moment you moved the story ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry Yes, this is how the audit log looks for me too.
For you, did the Epic which was linked to the Story previously still list the converted Epic under it ?
Could it be because, the Automation is processing to remove the Epic Link AFTER its changed to an Epic, but in reality an Epic issue type does not have a Feature Link ? Will it be possible to remove the field that happens :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, the automation rule is working correctly. See attachment history of the Epic, you can see that the story transformed to Epic is removed.
Are your Story and Epic created in the same project ? If so, please try to reindex the project, and, if not working, try a global reindex.
What do you mean "Feature link" ? What is your version of Jira ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We use the name change of Feature instead of Epic. Its the same Epic link, (but for us its the 'Feature Link") . . Our version is 9.4.14 . . Oh, okay, let me try to re-index the Feature project.
Actually, our team projects do not contain the Epic issue type. So, using Bulk update moved the Story to a new project and updated its issue type. Could that be the problem ? This is making me crazy, coz its a pretty basic automation rule, yet its not working for me. . lol :D:D
Just one more thing, when you change the converted Epic back to a Story, does the Epic Link come back or it stays empty ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am on 9.12.10, so there could be a discrepancy here. But I just tried not only moving the issue to another issue type, but also to another project.
And *boom*, the problem persists. Even after project reindex, the epic link is still there, on the parent.
And the automation shows success.
I guess it is a good ol' ScriptRunner use case then ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lol , so it works if its within the same project !! I guess that Bug ( https://jira.atlassian.com/browse/JSWSERVER-12133 ) is still valid, but surprised why its been ghosted . . The workaround is rathe troublesome.
If using Scriptrunner Listener, you think it could be possible ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some reason, the listener works if I the issue type change is from Epic to Story, but not when its from Story to Epic . . The Epic Link just cannot be removed no matter what ! ;(;(;(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M ,
I have played around with the listeners, but somehow it does not trigger on move event, which is strange since I actually "Move" (literally click on the move button).
In some cases, it triggers on the Updated event, Do you have a similar problem ?
I need to check and find a workaround.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same errors, kind of
I have kept "All issue event, issue updated & issue moved" . . For me it works when the issue type is moved within the SAME project . . But not when it is moved between different projects (even though, the listener is enabled GLOBALLY)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry At this point I have tried every possible way, Automation, Automation with script, Script listener - remove links, remove based on Field ID & Issue type ID . . Everything works if its between same project.
Do you know any way to have a JQL to filter Epics with an "Epic Link" , or maybe filter out the Epics what are linked to an Epic . . Maybe could explore the option of using Jobs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M ,
That is actually a lead, I cannot reproduce the problem anymore, does this query return any issue ?
"Epic Link" is not empty and type = Epic
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope . . Doesn't return anything . . .
Unable to find a query to list the Epics linked to an Epic , maybe because the Epic isn't supposed to actually have the Epic Link
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And do you still actually have an Epic with another Epic listed in "Issues in epic" on the issue itself ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yup, I have an Epic under an Epic (as part of testing) . . . I have been testing left right & center, at this point dreaming about Epic Links :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try to run this script in Script Console after replacing the issue key with your Epic (which was previously a Story)
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
// the issue key of the issue that will be added to an epic
final String issueKey = "ABC-123"
// the name of the custom field to update (in our case is the Epic Link)
final String epicLinkFieldName = "Epic Link"
def issueManager = ComponentAccessor.issueManager
def issue = issueManager.getIssueByCurrentKey(issueKey)
def targetField = ComponentAccessor.customFieldManager.getCustomFieldObjects(issue).findByName(epicLinkFieldName)
targetField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(targetField), null), new DefaultIssueChangeHolder())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's really strange, this script should clear the value if it exists...
Have you tried doing a global reindex (no background) and see if there is any improvement ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The same script works if its a STORY issue type . . But doesn't work if its an Epic
Actually everything works ONLY if the issue type change is between same project
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M ,
I think you should open a ticket at atlassian support. They will probably analyze your support zip and logs. This is what I do when I do when something similar happens on my instance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry I have actually dropped it, because, nothing seems to work, and everything points to the Bug Atlassian has for the "Feature Link" . . the only work around available is to move the Feature back to story, remove the feature link and then convert it again . .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Antoine Berry Hellooooo ! Hope you are doing amazing :):) Can I please get your thoughts on this ? ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aisha M , glad to hear from you ! I am doing great, how a bout you ?
Do you want to achieve this for new issues only, or do you wish to clear your history ?
Could you please check the "Audit log" of the automation rule ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If similar approach didn't work, it is possible that it is a bug, reach out to Atlassian support with this case
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Lucas Modzelewski _Lumo_ Thank you ! Just wondering why its not possible to clear a field when issue type is changed using Jira Automation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.
Learn more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.