Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need a way to clear "Epic Link"

Aisha M
Contributor
July 22, 2024

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, 

https://confluence.atlassian.com/automationkb/automation-for-jira-how-to-clear-the-parent-link-field-when-an-issue-is-moved-to-a-new-type-1206795140.html

But, when I try the same steps with Epic Link, it doesn't work. 

Any help on this is much appreciated. Thank you ! 

3 answers

1 accepted

0 votes
Answer accepted
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2024

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 :

remove epic link.png

Let me know how that goes for you.

Aisha M
Contributor
July 22, 2024

@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 

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2024

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.

Aisha M
Contributor
July 23, 2024

Let me test the Automation set  up in our UAT instead . . *fingers crosses*

Like • Antoine Berry likes this
Aisha M
Contributor
July 23, 2024 edited

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 - 

https://jira.atlassian.com/browse/JSWSERVER-12133 

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 23, 2024

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 ?

remove epic link automation log.png

Aisha M
Contributor
July 23, 2024 edited

@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 :(

Like • Antoine Berry likes this
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 23, 2024

Yes, the automation rule is working correctly. See attachment history of the Epic, you can see that the story transformed to Epic is removed.Epic child removed.png

 

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 ?

Aisha M
Contributor
July 23, 2024 edited

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 ?

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 23, 2024

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

Aisha M
Contributor
July 23, 2024 edited

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 ? 

 

 

Aisha M
Contributor
July 23, 2024

I tried using a Listener but that did not work either. Let me know if you want to try the listener ;) 

Aisha M
Contributor
July 24, 2024

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 ! ;(;(;(

Like • Antoine Berry likes this
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2024

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.

Aisha M
Contributor
July 26, 2024

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)

Aisha M
Contributor
July 30, 2024

@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   

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 30, 2024

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

 

Aisha M
Contributor
July 30, 2024

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 

 

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 30, 2024

And do you still actually have an Epic with another Epic listed in "Issues in epic" on the issue itself ?

Aisha M
Contributor
July 30, 2024

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 

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 30, 2024

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())

 

Aisha M
Contributor
July 30, 2024

This script runs but nothing happens . .  No logs, nothing ..  

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2024

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 ?

Aisha M
Contributor
August 1, 2024 edited

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 

Like • Antoine Berry likes this
Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 12, 2024

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.

Aisha M
Contributor
August 13, 2024

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

0 votes
Aisha M
Contributor
July 22, 2024

@Antoine Berry  Hellooooo ! Hope you are doing amazing :):) Can I please get your thoughts on this ? ;)

Antoine Berry
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 22, 2024

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 ?

0 votes
Lucas Modzelewski _Lumo_
Atlassian Partner
July 22, 2024

If similar approach didn't work, it is possible that it is a bug, reach out to Atlassian support with this case

Aisha M
Contributor
July 22, 2024

@Lucas Modzelewski _Lumo_ Thank you ! Just wondering why its not possible to clear a field when issue type is changed using Jira Automation

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

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
AUG Leaders

Upcoming Jira Events