Hi All,
I have been trying to execute the below script but its not yielding any result, can anyone please advise?
Hi All,
I trying the same script, but its not yielding any result, can you please help?
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchRequestEntity
import com.atlassian.jira.issue.search.SearchRequestManager
import com.atlassian.jira.util.Visitor
def filtersWithField = []
def myCustomFieldRegex = ~/(.Mobile OS.)|(.cf\[10801\].)/
def searchService = ComponentAccessor.getComponent(SearchService)
def searchRequestManager = ComponentAccessor.getComponent(SearchRequestManager)
searchRequestManager.visitAll(new Visitor<SearchRequestEntity>() {
@Override
void visit(SearchRequestEntity filter) {
def jql = filter.request
if (jql.findAll(myCustomFieldRegex)) {
filtersWithField << searchRequestManager.getSearchRequestById(filter.id)
}
}
})
log.warn filtersWithField
Hi @Ram ,
Welcome to the community!
If you would like to achieve this use case with ACLI ( https://marketplace.atlassian.com/apps/6398/jira-command-line-interface-cli?hosting=cloud&tab=overview ) which will be able to get the filters associated with specific custom fields.
--action getFilterList --columns 1,4,9 --outputType table --select "9:Closed Date/Time"
Please refer sample screenshot for reference.
https://appfire.atlassian.net/wiki/spaces/JCLI/overview
Thanks
Avinash
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.