Forums

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

Can I use Behaviours FormField in my Script Listener?

Karol Szacki September 6, 2018 edited

I would like to execute some Beahaviours field operations using my Script Listener :)

I would like to execute 'setError'.

I managed to make it work (compile?) using following imports

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours

 

but I get null result when trying to access FormField obj

def formField = getFieldById(getFieldChanged())

or

def formField = getFieldById("customfield_10515")

then this following line won't execute correctly because of this null

formField.setError("some text")

 Any help appreciated :)

2 answers

1 accepted

1 vote
Answer accepted
Alexey Matveev
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.
September 6, 2018

Hello,

You can not execute behaviour Scriptrunner Api in a listener.

Karol Szacki September 12, 2018 edited

I guess You and Mark (behaviours coding) are right about that.

Thank You

Alexey Matveev
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.
September 12, 2018

You are welcome!

0 votes
Deleted user September 6, 2018

I don't get it... why would you need to use a behaviour function in a listener? If this is in a screen, using behaviours shouldn't be enough?

Maybe I a have a low technical knowledge to understand your question ^^

Karol Szacki September 12, 2018 edited

To show some info on screen to the user who is performing some event dispatching  action, for example: moving issue,

It may not be possible, as Alexey stated :-/

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events