How to clear issue resolution field using Jelly script in JIRA

I need help with a Jelly script that should clear the resolution field for multiple JIRA issues. My script executes without throwing any errors, but it doesn’t actually update the resolution field to empty.

The script output shows:

<AtlassianJelly xmlns:atlassian='jelly:com.atlassian.jira.jelly.JiraTagLib' xmlns:logging='jelly:log' xmlns:main='jelly:core' xmlns:xml='jelly:xml' xmlns:utilities='jelly:util'>org.ofbiz.core.entity.GenericValue.NULL_VALUEorg.ofbiz.core.entity.GenericValue.NULL_VALUEorg.ofbiz.core.entity.GenericValue.NULL_VALUE.... </AtlassianJelly>

Here’s my current script:

<AtlassianJelly xmlns:atlassian="jelly:com.atlassian.jira.jelly.JiraTagLib" xmlns:utilities="jelly:util" xmlns:main="jelly:core" xmlns:xml="jelly:xml" xmlns:logging="jelly:log">
        <atlassian:ExecuteSearch var="ticketList" />

        <main:forEach var="ticketEntity" items="${ticketList}">
            <main:invokeStatic className="com.atlassian.jira.issue.IssueImpl" method="getIssueObject" var="ticketObject">
                <main:arg type="org.ofbiz.core.entity.GenericValue" value="${ticketEntity}"/>
            </main:invokeStatic>

            <main:invoke on="${ticketObject}" method="setResolution">
                <main:arg type="org.ofbiz.core.entity.GenericValue">org.ofbiz.core.entity.GenericValue.NULL_VALUE</main:arg>
            </main:invoke>

        </main:forEach>
</AtlassianJelly>

Any suggestions on what might be wrong or alternative approaches to remove the resolution value from tickets?

Your script’s missing the database save. setResolution() only changes the object in memory - JIRA won’t actually update anything without an explicit store operation.

I hit this same issue years ago with bulk custom field updates. Add <main:invoke on="${ticketObject}" method="store"/> right after your setResolution call inside the forEach loop.

Also, don’t pass that long string “org.ofbiz.core.entity.GenericValue.NULL_VALUE” - use an actual null value instead. Try <main:arg value="${null}"/> or just skip the argument if the method allows it.

One heads up: bypassing resolution changes like this might skip JIRA’s workflow validation. Make sure this won’t break any workflows that depend on resolution states in your instance.

you’re setting null wrong. don’t pass it as a string - use <main:arg value="${null}"/> or better yet, try ticketObject.getGenericValue().set("resolution", null) then store it. also double-check your ExecuteSearch is finding the right issues with proper filters.

You’re using setResolution on an IssueImpl object - that’s deprecated and won’t persist changes properly. You need to work with IssueManager and use the proper JIRA APIs instead. I’ve done similar bulk resolution clearing before. The most reliable way is using IssueManager.updateIssue() after creating a MutableIssue. Your current approach with direct GenericValue manipulation bypasses JIRA’s internal update mechanisms. Get the IssueManager component and use it to create a MutableIssue from your issue object. Then call setResolution(null) on that and update it through the manager. This ensures proper indexing and event firing. The store() method on IssueImpl doesn’t always trigger the reindexing that JIRA needs for resolution field changes.