Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JQL search with Groovy and custom field

Eric Schulz April 26, 2021

Hey :)

i want to search linked issues with the same custom field value like the parent issue.

If i return the issues i need, i want to fill a field with "new Date()"...

 

I don't know how to end the following script :D 

Result type is my query...

Or the whole script is stupid.... pls help.

---------

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def issueManager = ComponentAccessor.getIssueManager()

def issueTypeGroup = "(XX, YY)"
def fieldName = "Important-Number"
def linkeTypeName = "VIP"

def cFieldValue = issue.getAsString(fieldName)

if (cFieldValue == null) {
return
}

if (cFieldValue.size() == 0){
return
}

def query = jqlQueryParser.parseQuery("issuetype" + " in " + issueTypeGroup + " AND " + fieldName + " ~ " + cFieldValue)

Bildschirmfoto 2021-04-26 um 18.41.25.png

2 answers

0 votes
Rolf Lader
Community Champion
February 14, 2023

@Eric Schulzhave you found a solution to the problem?

Eric Schulz February 14, 2023

No :)

0 votes
Eric Schulz May 11, 2021

Nobody? :(

Suggest an answer

Log in or Sign up to answer