Forums

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

Coding first Listener Not firing.

CJ_Marchand
Contributor
May 17, 2023

 

 

Hi everyone.

I built a Behavior that is working but am not having luck with Listener.

The listener does not seem to be firing.

I need it to fire on a field changed event. 

I added the "Issue create" Event to see if I could get anything but am not having any luck.   

 

This is my code for now.

I have stripped it code down for testing.  Just want to see the event fire.

 

import com.atlassian.jira.issue.Issue                       ;
import com.onresolve.jira.groovy.user.FieldBehaviours       ;
import groovy.transform.BaseScript                          ;
import com.atlassian.jira.issue.IssueFieldConstants         ;
@BaseScript FieldBehaviours fieldBehaviours                 ;


try {
     getFieldById('customfield_18801').setFormValue( "Hello txtField" ) ;    
    getFieldById('description').setFormValue( "Hello from Listener" ) ;
} catch(Exception e1) {
    getFieldById('customfield_18801').setFormValue( e1.getMessage() ) ;
}

pic of my Listener setup is included.

 

2 answers

Suggest an answer

Log in or Sign up to answer
0 votes
Daniel Yelamos [Adaptavist]
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 Champions.
August 15, 2017

Hi Andrew. Alaeksander is right. That should work.

"underlyingIssue" is the object that the DB currently has before it is updated by your form. 

Can you tell me how you have setup your behaviour?

Cheers

Dyelamos

Andrew L
Contributor
August 22, 2017

Daniel,

It looks like there's a problem with my test instance of Jira (or the Jira Behaviors plugin running on the test instance of Jira).

I was able to get my logic working properly on another instance.

Thanks

--Andrew

Suresh Srini
December 15, 2020

Hi,

I am trying to read selected priority field value on the screen for my process. can you shar the steps or code here?

0 votes
Aleksandr Zuevich
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 Champions.
August 15, 2017

Hi Andrew,

I've tried your snippet and always get the original priority (I change the priority in the edit issue dialog).

Andrew L
Contributor
August 22, 2017

Aleksandr

It looks like there's a problem with my test instance of Jira (or the Jira Behaviors plugin running on the test instance of Jira).

I was able to get my logic working properly on another instance.

Thanks

--Andrew


TAGS
AUG Leaders

Atlassian Community Events