updating Fix Version/s field via script listener in script runner

Hi all...I am having an issue updating the Fix Version/s field via a listener in script runner. For some reason the line that actually set the Fix Version/s field is not executing, so the the Fix Version/s field is not being updated. I am getting the correct string for the version I want to update the Fix Version/s field to and the version is indeed defined as a version for the project, but still the field is not being updated. This line seems to be doing what is expected to do, which is actually to update the Fix Version/s field:



I have tried a couple of suggestions from two of the techies from Adaptavist but none worked.

Thank you for your assistance!

Here is the complete script:


import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.project.Project
import com.atlassian.jira.project.version.Version
import com.atlassian.jira.project.version.VersionManager


def change = event?.getChangeLog()?.getRelated("ChildChangeItem").find {it.field == "Target Release"}
if (change) {

def customFieldManager = ComponentAccessor.getCustomFieldManager()
VersionManager versionManager = ComponentAccessor.versionManager
Issue issue = event.issue
def key=issue.getKey()

Object plugin = ComponentAccessor.getPluginAccessor().getPlugin("com.valiantys.jira.plugins.SQLFeed");
Class serviceClass = plugin.getClassLoader().loadClass("com.valiantys.nfeed.api.IFieldDisplayService");
ComponentManager componentManager = ComponentManager.getInstance();
Object fieldDisplayService = componentManager.getOSGiComponentInstanceOfType(serviceClass);
Object displayResult = fieldDisplayService.getDisplayResult(key, "customfield_12100");
String display = ""
display = displayResult.getDisplay();
log.warn("display: " + display)
Project project = issue.getProjectObject()
Version versionFX = versionManager.getVersion(project.getId(), display as String)
log.warn("versionFX: " + versionFX)
//def versions = issue.getFixVersions()
//log.warn("current versions: " + versions)
//log.warn("appended versions: " + versions)

log.warn("no change of Target Release")



1 answer

0 votes

Hi Tomas,

I believe @Ashraful Hasan [Adaptavist] answered your question through our support portal. You no longer need help with this, correct? Feel free to post the script here if you'd like to share it with others. :)



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,186 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you