The sorting has broken when value in the script field is changed without editing a JIRA issue.
import com.atlassian.jira.component.ComponentAccessor
def closeNames = ["Closed", "Resolved"]
def issueLinkManager = ComponentAccessor.getIssueLinkManager()
def issueLinks = issueLinkManager.getInwardLinks(issue.id)
def subElements = issueLinks.findAll {
it.getIssueLinkType().getName() == "Bug to Story"
}.findAll {
!(it.sourceObject.status.name in closeNames)
}.findAll {
it.sourceObject.issueTypeObject.name == "Bug"
}
return subElements.size() as Double
Please help investigate, is this a bug or is there any solution to fix this problem?
Thank you in advance. Any question on my information above, please let me know.
Regards,
Orawan.
Hi Thanos,
I use Search Template "Number range searcher".
This is not technically correct in the background, but an easy way to think about scripted fields is that "they store their data in the index, so they only get updated when an issue is indexed". The changes you are making to issues at the other end of the links do not trigger any indexing on the Story.
Sadly, for links, there's no way to fix this that I know of - changes to links don't fire events that could be caught and checked for changes that might need an indexing run against an issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nic,
Thank you for this information T_T
May I ask you, is it possible to have improvement regarding this case in new version of JIRA or ScriptRunner plug-in?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
An improvement here would need JIRA to support the firing of events for changes on links. I'm not sure ScriptRunner could be made to handle anything without support from JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Orawan,
What Searcher and Template you use for your scripted field ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.