I am trying to write a jelly script. The script needs to execute a filter to retrieve a list of issues (no problem). I then need to iterate through those returned issues (again no problem) and look at the linked issues that are associated with each issue. Jelly doesn't have a tag to get the list of linked issues so i was wondering if there was a way that I could execute a JQL query that called the JQL Tricks plugin that returns a list of linked issues. Alternatively if it was possible you could call a filter (that called the JQL Tricks plugin) and pass in the key of the issue but as far as I can see this is not possible.
Yup but its very longwinded:
<core:invokeStatic className="com.atlassian.jira.ComponentManager" method="getInstance" var="componentManager"/>
<core:invokeStatic className="java.lang.Class" method="forName" var="searchProviderClass">
<core:arg value="com.atlassian.jira.issue.search.SearchProvider"/>
</core:invokeStatic>
<core:invoke on="${componentManager}" method="getComponentInstanceOfType" var="searchProvider">
<core:arg value="${searchProviderClass}"/>
</core:invoke>
<core:new className="com.atlassian.jira.jql.parser.DefaultJqlQueryParser" var="queryParser"/>
<core:invokeStatic className="com.atlassian.jira.web.bean.PagerFilter" method="getUnlimitedFilter" var="UNLIMITED_FILTER"/>
<core:set value="status = Open" var="query"/>
<core:invoke on="${searchProvider}" method="search" var="queryResults">
<core:arg value="${queryParser.parseQuery(query)}"/>
<core:arg value="${jelly.user}"/>
<core:arg value="${UNLIMITED_FILTER}"/>
</core:invoke>
I tried the above script and am getting error
Error: <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log">
Exception: org.apache.commons.jelly.JellyTagException: null:22:0: No such accessible method: search() on object: com.atlassian.jira.issue.search.providers.LuceneSearchProvider
java.io.PrintWriter@e5aa54
Jelly script is
<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:log="jelly:log" >
<jira:Login username="usr1" password="abc123">
<log:warn>Running Inactivate issues service</log:warn>
<core:invokeStatic className="com.atlassian.jira.ComponentManager" method="getInstance" var="componentManager"/>
<core:invokeStatic className="java.lang.Class" method="forName" var="searchProviderClass">
<core:arg value="com.atlassian.jira.issue.search.SearchProvider"/>
</core:invokeStatic>
<core:invoke on="${componentManager}" method="getComponentInstanceOfType" var="searchProvider">
<core:arg value="${searchProviderClass}"/>
</core:invoke>
<core:new className="com.atlassian.jira.jql.parser.DefaultJqlQueryParser" var="queryParser"/>
<core:invokeStatic className="com.atlassian.jira.web.bean.PagerFilter" method="getUnlimitedFilter" var="UNLIMITED_FILTER"/>
<core:set value="project = TRM and status = On hold" var="query"/>
<core:invoke on="${searchProvider}" method="search" var="queryResults">
<core:arg value="${queryParser.parseQuery(query)}"/>
<core:arg value="${jelly.user}"/>
<core:arg value="${UNLIMITED_FILTER}"/>
</core:invoke>
<core:forEach var="issue" items="${issues}">
<log:warn>Inactivating issue ${issue.key}</log:warn>
</core:forEach>
</jira:Login>
</JiraJelly>
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.