Hello visitor,
If you are expereincing this error:
2021-10-25 11:43:03,002+0200 http-nio-8080-exec-447 ERROR raul.pelaez 703x3723617x7 1kl3whl 213.229.153.41,10.12.2.26 /browse/THE_EPIC_ISSUE_KEY [c.a.j.web.component.ModuleWebComponentImpl] An exception occured while rendering the web panel: com.pyxis.greenhopper.jira:greenhopper-epics-issue-web-panel (null)
java.lang.NullPointerException: The validated object is null
Probably exist a corrupted linked issue in this Epic.
Atlassian recommneds to fix it, do operations with SQL, but that is NOT my recommendation:
Probably the better solution is to run a little Groovy Script in Scriptrunner using the “Script Console” to run just one time!
Here is the code that does the trick!
import groovy.json.JsonSlurper;
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.user.util.UserManager
import com.atlassian.jira.user.UserUtils
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.bc.user.search.UserSearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager
import com.atlassian.jira.issue.link.IssueLinkTypeManager
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
import edreamsodigeo.MyCompanyProperties
import com.atlassian.jira.issue.MutableIssue;
import com.atlassian.jira.issue.IssueManager;
IssueManager issueMgr = ComponentAccessor.getIssueManager();
def issue = issueMgr.getIssueObject("THE_EPIC_ISSUE_KEY")
IssueLinkTypeManager issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)
IssueLinkManager issueLinkManager = ComponentAccessor.issueLinkManager
def sb = new StringBuilder()
def i = 0
def linkType = issueLinkTypeManager.getIssueLinkTypes(false).find{ it.name == 'Epic-Story Link' }
def issueLinkList = issueLinkManager.getOutwardLinks(issue.id).findAll{ it.getLinkTypeId() == linkType.getId() }
for (issueLink in issueLinkList) {
def childIssue = issueLink.getDestinationObject()
try{
sb = sb + childIssue.getKey() + ","
log.warn sb
} catch (Exception e) {
log.warn "Removing error link..."
issueLinkManager.removeIssueLink(issueLink, currentUser)
}
i++
}
return "OK"
That’s all!
By MrAddon
.