Script Listeners do not appear, cannot be viewed

Cristina_Abunei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 28, 2017

Hello,

Our script listeners do not appear anymore in the page where they should be viewed.

We can still add others, and they still work, as we can see their effects, but we cannot modify already added ones because we cannot see them.

I added a screenshot to be more clear.

Running the below in our database:

SELECT * FROM PROPERTYTEXT left join PROPERTYENTRY on  PROPERTYTEXT.ID = PROPERTYENTRY.ID where PROPERTY_KEY='com.onresolve.jira.groovy.groovyrunner:groovyrunner';

gives us the following result:

empty.png

If we run:

\copy (SELECT * FROM PROPERTYTEXT left join PROPERTYENTRY on  PROPERTYTEXT.ID = PROPERTYENTRY.ID where PROPERTY_KEY='com.onresolve.jira.groovy.groovyrunner:groovyrunner') To '/tmp/testingview.csv' With CSV Delimiter ','

 

all existing script listeners get copied into a csv;

When removing all script listeners, the database shows correct results:

image2017-3-1 10:17:49.png

When starting to add them back, after a few are added, they just randomly disappear. When they can still be viewed in JIRA, they also appear in the database.

Any ideas?

Thank you!

3 answers

0 votes
John Hwhy August 20, 2018

 Hello @Tomas Arguinzones,

Were you able to resolve or troubleshoot the issue in some specific way? Unfortunately, I have faced the same problem with script listeners (and script fields) on my end.

Tomas Arguinzones Yahoo August 28, 2018

Hi John...sorry for the delayed response (I was on vacation). Yes, I did fix it.  It is most likely one or more of your listeners got duplicated somehow. Please run this script to verify:

import com.onresolve.scriptrunner.runner.ListenerManagerImpl
import com.onresolve.scriptrunner.runner.util.OSPropertyPersister
import groovy.json.JsonBuilder

def listeners = OSPropertyPersister.loadList(ListenerManagerImpl.CONFIG_LISTENERS)

new JsonBuilder(listeners).toString()

 

You need to find which listener(s) is duplicated and remove the duplicated. You can also run the built-in script that get the list of the script registry and check there if you see any listeners/script fields duplicated. Once you determine/find the duplicates, run the following script from the script console to delete the duplicates:

 

import com.onresolve.scriptrunner.runner.util.OSPropertyPersister
import com.onresolve.scriptrunner.runner.ListenerManagerImpl
import com.onresolve.scriptrunner.runner.ListenerManager
import com.onresolve.scriptrunner.runner.ScriptRunnerImpl

def listenerManager = ScriptRunnerImpl.getPluginComponent(ListenerManager) as ListenerManager

List newlist = OSPropertyPersister.loadList(ListenerManagerImpl.CONFIG_LISTENERS)

def node = newlist.find {it.FIELD_FUNCTION_ID = '6d5021232c9004347760ea09e439aeb030a4150f'} //-<GET YOUR ID HERE

newlist.remove(node)

OSPropertyPersister.save(newlist, ListenerManagerImpl.CONFIG_LISTENERS)

listenerManager.refresh()

newlist
0 votes
Tomas Arguinzones January 25, 2018

Hi @Cristina_Abunei how did you fix this? I am having the same issue where I can not see any of my script listeners...all of the sudden they are not loading.

 

Thanks

Cristina_Abunei
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 25, 2018

Hi @Tomas Arguinzones

The problem seems to have solved itself mostly, because we did not change a listener and we were not really able to find a problematic one.

We added them all again (lucky for us we had them stored elsewhere too), and they disappeared again, and then we added them all again and they haven't disappeared.

Also, for us, when it happened, they were somehow only missing from the interface, as their effects were still happening. 

Sorry I don't have a clear solution, but I would also try what Jonny suggested in the above comment, perhaps there is a problematic one.

0 votes
Jonny Carter
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2017

We tend to see this when one or two listeners have serious compilation problems.

You mentioned that after adding a few listeners manually, the problem resurfaces. It might be worthwhile to specifically note which listener it is that seems to break the UI when you add it. Try adding a listener and refreshing the page one at a time until you find the problematic listener. You can then add its code to your question here or in another question for review.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events