Forums

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

ScriptRunner - Using Listner to set custom field query

BBC Application Admin Team June 8, 2020

Hi,

I'm doing the same as was outlined in the solution below, but from a listener.

https://community.atlassian.com/t5/Jira-questions/Set-custom-field-value-Script-Runner/qaq-p/1042485

i'm updating a single select list with a value when issue_update and resolve_issue events occur. The value depends on values from a number of other fields and this part works fine..

However, following running the script against an issue (from the console or by triggering an event), the field populates fine, but the issue doesn't show up in search results until another update (not from the listener) has occured.

I've been tempted to change the EventDispatchOption to send the event, as i've been wondering if this is the reason for the behaviour, but then i'm worried that the listener will pick this back up again and end up in an infinite loop.

Do you know if the above would be the cause? or am I missing something else that I need to do so that the value that the listener has added is immediately searchable?

My next step would probably be to attempt to update the field using a specific user, then find some way of filtering out those events so he listener doesn't do anything with them, but I'm wondering if there is an easier solution.

Thanks.

1 answer

1 accepted

0 votes
Answer accepted
BBC Application Admin Team June 9, 2020

Hi,

I've found the answer & confimed it works (for us anyway), so this so posting here in case anyone else hits the same -

https://community.atlassian.com/t5/Jira-questions/ScriptRunner-updating-fields-not-displaying-in-JQL-Searches/qaq-p/1145038

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, jira service management, jsm webinar, ai in jsm, opsgenie integration, incident management, virtual agent, atlassian intelligence, ai-powered service desk, it operations, atlassian learning, service management webinar, team '25 recap

What’s new in Jira Service Management 🤔

Discover how Atlassian is revolutionizing service management with cutting-edge solutions for AI-powered support, HR Service Management, or DevOps connectivity.

Register here ⬇️
AUG Leaders

Atlassian Community Events