Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner Listener expected performance

Andreas Lorz
Contributor
August 27, 2020

Hi all,

I'm writting my first script which I want to use in a Custom Listener (ScriptRunner Listener). 

As Event I have to use the issue updated event. Although I only need this for one specific issuetype.

Since this will run in production all the time I asked myself if there are any performance issues to be expected?

Maybe someone have a Listner running on update Issue event and can share his or her experience.

I just queryed for the amount of updated issues. Today about 2000. But it's holiday season ;)

Thanks in advance

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Ram Kumar Aravindakshan _Adaptavist_
Community Champion
June 21, 2021

Hi @Marco Brundel

From your description, the reason why the code appears to be failing is that. 

1) You are initialising a bound variable, i.e. customFieldManager, as shown in the image below:-

default_comment_config.png

The example code provided in the documentation is a bit outdated and needs to be updated.

2) Whenever you want to pass the value from the Groovy code into the Comment template, you will need to use the config variable. However, you are directly passing the variable, i.e. backofficeCf, into your template in your case. This will not work.

Below is an example working code for your reference:-

import com.atlassian.jira.component.ComponentAccessor

def sampleList = customFieldManager.getCustomFieldObjectsByName("Sample List")[0]

config.sampleListValue = issue.getCustomFieldValue(sampleList) ?: 0

return true

Please note, this example code is not 100% exact to your environment. Hence, you will need to make the required modifications.

Below is a print screen of the configuration:-

config.pngIf you observe the print screen above, I am passing the config.sampleListValue into the comment template i.e. 

The value selected is ${config.sampleListValue}

 Below is an example of the output:-

test1.png

I hope this helps to answer your question. :)

Thank you and Kind Regards,

Ram

TAGS
AUG Leaders

Atlassian Community Events