Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Custom field updated by script listener gives wrong query results


I would very much appreciate your help with something since it's been bothering me for a while.

I have created a custom field (single select list) and created a script listener that updates this field every time the assignee field changes.

It works well, but for some reason, once in a while a query on this field will give incorrect results. For example, I can run this query: field="Option 1"

While "field" is the custom field name and "Option 1" is one of the possible options.

Most of the issues that will answer this query will be correct, but once in a while I might find there an issue with field="Option 2", although it shouldn't be there.

Does anybody have an idea why is this happening?



1 answer

1 accepted

0 votes
Answer accepted

It sounds like the index is not being updated properly in every case.

How is the listener writing back to the issue?

Hi Nic,

Thanks for the quick response.

This is how I update the field in the listener:


def value = ComponentAccessor.optionsManager.getOptions(cfConfig)?.find {
it.toString() == new_value
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), value),changeHolder)


new_value is just a string.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

544 views 15 18
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you